hexo/node_modules/osx-release/cli.js

42 lines
688 B
JavaScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
#!/usr/bin/env node
'use strict';
var argv = require('minimist')(process.argv.slice(2));
var pkg = require('./package.json');
var osxRelease = require('./');
var input = argv._[0];
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Usage',
' osx-release [release]',
'',
' Example',
' osx-release',
' Mavericks 10.9',
'',
' osx-release 14.0.0',
' Yosemite 10.10'
].join('\n'));
}
if (!input || argv.help) {
help();
return;
}
if (argv.version) {
console.log(pkg.version);
return;
}
var output = osxRelease(input);
if (!output.name || !output.version) {
process.exit(1);
}
console.log(output.name + ' ' + output.version);