tachybase_todo/packages/core/build/bin/tachybase-build.js

30 lines
686 B
JavaScript
Executable File

#!/usr/bin/env node
const { existsSync } = require('fs');
const { join } = require('path');
const yParser = require('yargs-parser');
const chalk = require('chalk');
const { build } = require('../lib');
// print version and @local
const args = yParser(process.argv.slice(2), {
alias: {
package: 'p',
},
});
if (args.v || args.version) {
console.log(require('../package').version);
if (existsSync(join(__dirname, '../.local'))) {
console.log(chalk.cyan('@local'));
}
process.exit(0);
}
// Notify update when process exits
const updater = require('update-notifier');
const pkg = require('../package.json');
updater({ pkg }).notify({ defer: true });
build(args._);