1
0
mirror of synced 2025-11-10 05:47:40 +00:00

feat(CLI): add support for TYPESCRIPT_STARTER_REPO_BRANCH process.env, default to tag of current rel

This commit is contained in:
Jason Dreyzehner
2018-03-15 21:12:59 -04:00
parent e68eddbe12
commit 24ef06e1fe
9 changed files with 166 additions and 63 deletions

View File

@@ -2,23 +2,23 @@
import chalk from 'chalk';
import { checkArgs } from './args';
import { inquire } from './inquire';
import { getInferredOptions, LiveTasks } from './tasks';
import { addInferredOptions, LiveTasks } from './tasks';
import { typescriptStarter } from './typescript-starter';
import { getIntro, TypescriptStarterUserOptions } from './utils';
import { getIntro, hasCLIOptions, TypescriptStarterUserOptions } from './utils';
(async () => {
const cliOptions = await checkArgs();
const userOptions = cliOptions.projectName
? (cliOptions as TypescriptStarterUserOptions)
const argInfo = await checkArgs();
const userOptions: TypescriptStarterUserOptions = hasCLIOptions(argInfo)
? argInfo
: {
...(await (async () => {
console.log(getIntro(process.stdout.columns));
return inquire();
})()),
...cliOptions // merge in cliOptions.install
...argInfo
};
const inferredOptions = await getInferredOptions();
return typescriptStarter({ ...inferredOptions, ...userOptions }, LiveTasks);
const options = await addInferredOptions(userOptions);
return typescriptStarter(options, LiveTasks);
})().catch((err: Error) => {
console.error(`
${chalk.red(err.message)}