Skip to content

Commit e4fb966

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular/cli): add text to help output to indicate that additional commands are available when ran in different context
With this change we add a footer to indicate that more commands are available when running the CLI in a different context. Ie inside or outside of a workspace. (cherry picked from commit cefbffe)
1 parent 66a1d6b commit e4fb966

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/angular/cli/src/command-builder/command-runner.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis
155155
'deprecated: %s': colors.yellow('deprecated:') + ' %s',
156156
'Did you mean %s?': 'Unknown command. Did you mean %s?',
157157
})
158+
.epilogue(colors.gray(getEpilogue(!!workspace)))
158159
.demandCommand(1, demandCommandFailureMessage)
159160
.recommendCommands()
160161
.middleware(normalizeOptionsMiddleware)
@@ -173,3 +174,18 @@ export async function runCommand(args: string[], logger: logging.Logger): Promis
173174

174175
return process.exitCode ?? 0;
175176
}
177+
178+
function getEpilogue(isInsideWorkspace: boolean): string {
179+
let message: string;
180+
if (isInsideWorkspace) {
181+
message =
182+
'The above commands are available when running the Angular CLI inside a workspace.' +
183+
'More commands are available when running outside a workspace.\n';
184+
} else {
185+
message =
186+
'The above commands are available when running the Angular CLI outside a workspace.' +
187+
'More commands are available when running inside a workspace.\n';
188+
}
189+
190+
return message + 'For more information, see https://angular.io/cli/.\n';
191+
}

0 commit comments

Comments
 (0)