mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
27 lines
653 B
JavaScript
Executable File
27 lines
653 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
const minimist = require('minimist');
|
|
const path = require('path');
|
|
|
|
const args = minimist(process.argv.slice(2), {
|
|
boolean: ['verbose']
|
|
});
|
|
const scriptName = args._.shift();
|
|
const scriptPath = path.join('../scripts', scriptName);
|
|
|
|
const cwd = process.cwd();
|
|
process.chdir(path.join(__dirname, '..'));
|
|
|
|
|
|
try {
|
|
Promise.resolve()
|
|
.then(() => require(scriptPath).default(args, cwd))
|
|
.then(exitCode => process.exit(exitCode || 0))
|
|
.catch(err => {
|
|
console.error(err && err.stack);
|
|
process.exit(99);
|
|
});
|
|
} catch (err) {
|
|
console.error(err.stack);
|
|
process.exit(99);
|
|
}
|