Denys Vuika 6f209726e9
[AAE-10472] Upgrade and deprecate libs (#7788)
* upgrade and deprecate libs

* upgrade flex layout

* cleanup tslint libs

* diable the test

* exclude flaky e2e
2022-08-26 16:56:51 +01:00

45 lines
1.1 KiB
JavaScript
Executable File

#!/usr/bin/env node
const minimist = require('minimist');
const path = require('path');
const fs = require('fs');
function printHelp() {
const pkgData = fs.readFileSync(path.resolve(__dirname, '..', 'package.json'));
const { name, version } = JSON.parse(pkgData);
console.log(`${name} v${version}`);
}
const args = minimist(process.argv.slice(2), {
boolean: ['verbose']
});
if (args._.length === 0) {
printHelp();
process.exit(1);
}
const scriptName = args._.shift();
const scriptPath = process.env.DEVELOP
? path.resolve(path.join(__dirname, '../dist/scripts', scriptName))
: path.resolve(path.join(__dirname, '../scripts', scriptName));
if (!fs.existsSync(`${scriptPath}.js`)) {
console.error(`Error: command ${scriptName} not found.`);
process.exit(1);
}
const cwd = process.cwd();
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);
}