Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes https://github.com/citation-style-language/abbreviations/issues/4 #6

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
29 changes: 29 additions & 0 deletions build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require('path')
const fs = require('fs')

const lists = [
'american-journal-of-archaeology/abbreviations.json', // fixed list
'medline/abbreviations.json', // fixed list from Zotero
]
.concat(require('./ncbi'))
.map(list => list[0] === '/' ? path.relative(__dirname, list) : list)

const published = require('./package.json').files

let errors = false
for (const list of lists) {
if (!published.includes(list)) {
console.log(`found unpublished ${list}`)
errors = true
}
}
for (const list of published) {
if (!lists.includes(list)) {
console.log(`I don't know about ${list}`)
errors = true
}
}

if (errors) process.exit(1)

fs.writeFileSync('index.js', `module.exports = ${JSON.stringify(lists, null, 2)};\n`)
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = [
"american-journal-of-archaeology/abbreviations.json",
"medline/abbreviations.json",
"ncbi/abbreviations.json"
];
Loading