Skip to content

Commit

Permalink
[INTERNAL] Make --version also display CLI location
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomByte committed Oct 16, 2018
1 parent ce148a2 commit bc59b85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bin/ui5.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ setTimeout(() => {

// Explicitly set CLI version as the yargs default might
// be wrong in case a local CLI installation is used
cli.version(pkg.version);
// Also add CLI location
cli.version(`${pkg.version} (from ${__filename})`);

// Explicitly set script name to prevent windows from displaying "ui5.js"
cli.scriptName("ui5");
Expand Down
4 changes: 2 additions & 2 deletions test/lib/cli/commands/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const ui5 = (args, options = {}) => execa(ui5Cli, args, options);

test("ui5 --version", async (t) => {
const {stdout} = await ui5(["--version"]);
t.is(stdout, pkg.version);
t.is(stdout, `${pkg.version} (from ${ui5Cli})`);
});

test("ui5 -v", async (t) => {
const {stdout} = await ui5(["-v"]);
t.is(stdout, pkg.version);
t.is(stdout, `${pkg.version} (from ${ui5Cli})`);
});

0 comments on commit bc59b85

Please sign in to comment.