fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-27 02:42:58 +01:00
parent f36dea3875
commit d5852ce85d
2 changed files with 22 additions and 0 deletions

View File

@ -10,6 +10,7 @@
},
"scripts": {
"test": "tsrun test/test.ts",
"testCustom": "node cli.ts.js custom ts_web",
"build": "node cli.ts.js"
},
"repository": {

View File

@ -3,6 +3,9 @@ import * as tsbuild from './tsbuild.exports';
const tsbuildCli = new plugins.smartcli.Smartcli();
/**
* the standard task compiles anything in ts/ directory to dist directory
*/
tsbuildCli.standardTask().subscribe(argvArg => {
if (process.env.CLI_CALL_TSBUILD === 'true') {
tsbuild.compileGlobStringObject(
@ -16,4 +19,22 @@ tsbuildCli.standardTask().subscribe(argvArg => {
}
});
/**
* the custom command compiles any customDir to dist_customDir
*/
tsbuildCli.addCommand('custom').subscribe(argvArg => {
const listedDirectories = argvArg._;
listedDirectories.shift();
const compilationCommandObject: {[key: string]: string} = {};
for (const directory of listedDirectories) {
compilationCommandObject['./' + directory] = './dist_' + directory;
};
tsbuild.compileGlobStringObject(
compilationCommandObject,
{},
process.cwd(),
argvArg
);
})
tsbuildCli.startParse();