Skip to content

Commit

Permalink
Fix --alloy support
Browse files Browse the repository at this point in the history
  • Loading branch information
cb1kenobi committed Jan 8, 2024
1 parent e2f0a11 commit 114ee0d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,22 @@ export class CLI {
this.logger.skipBanner(true);
}

// this is for `ti create`
if (conf.platforms) {
this.debugLogger.trace(`Detected conf.platforms loading "${cmdName}", overriding createHelp()`);
this.command.createHelp = () => {
return Object.assign(new TiHelp(this, conf.platforms), this.command.configureHelp());
};
// `ti create` hacks
if (cmdName === 'create') {
// if `--alloy` is not defined, define it
if (!conf.flags.alloy) {
conf.flags.alloy = {
desc: 'initialize new project as an Alloy project'
};
}

// if we have a `--platforms` option branch, override the help
if (conf.platforms) {
this.debugLogger.trace(`Detected conf.platforms loading "${cmdName}", overriding createHelp()`);
this.command.createHelp = () => {
return Object.assign(new TiHelp(this, conf.platforms), this.command.configureHelp());
};
}
}

applyCommandConfig(this, cmdName, cmd, conf);
Expand Down

0 comments on commit 114ee0d

Please sign in to comment.