Files
hls.js/scripts/check-already-published.js
T
Tom Jenkinson 79a81e3771 Release with travis (#1810)
- Automatically publish a new NPM package when a new git tag is pushed
- Create a draft github release and add the build files as attachments
2018-08-09 15:34:11 -04:00

21 lines
477 B
JavaScript
Executable File

'use strict';
const packageJson = require('../package.json');
try {
if (versionPublished()) {
console.log('published');
} else {
console.log('not published');
}
} catch(e) {
console.error(e);
process.exit(1);
}
process.exit(0);
function versionPublished() {
// npm view returns empty string if package doesn't exist
return !!require('child_process').execSync('npm view ' + packageJson.name + '@' + packageJson.version + ' --json').toString().trim();
}