Skip to content

Commit

Permalink
fix: change 'out' to 'outDir' (#284)
Browse files Browse the repository at this point in the history
* fix: change 'out' to 'outDir'

* chore: add changeset

---------

Co-authored-by: MJ☔ <[email protected]>
  • Loading branch information
0618 and zhamujun authored Sep 22, 2023
1 parent 813cdfb commit 4fd18b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-paws-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/backend-cli': patch
---

fix: change 'out' to 'outDir'
6 changes: 4 additions & 2 deletions packages/cli/src/commands/sandbox/sandbox_command.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ describe('sandbox command', () => {
});

it('starts sandbox with user provided output directory for client config', async () => {
await commandRunner.runCommand('sandbox --out test/location --format js');
await commandRunner.runCommand(
'sandbox --outDir test/location --format js'
);
assert.equal(sandboxStartMock.mock.callCount(), 1);
assert.deepStrictEqual(
sandboxStartMock.mock.calls[0].arguments[0].clientConfigFilePath,
Expand All @@ -75,7 +77,7 @@ describe('sandbox command', () => {
assert.match(output, /--dirToWatch/);
assert.match(output, /--exclude/);
assert.match(output, /--format/);
assert.match(output, /--out/);
assert.match(output, /--outDir/);
});

it('fails if invalid dirToWatch is provided', async () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/commands/sandbox/sandbox_command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type SandboxCommandOptions = {
exclude: string[] | undefined;
name: string | undefined;
format: ClientConfigFormat | undefined;
out: string | undefined;
outDir: string | undefined;
profile: string | undefined;
};

Expand Down Expand Up @@ -57,7 +57,7 @@ export class SandboxCommand
exclude: args.exclude,
name: args.name,
format: args.format,
clientConfigFilePath: args.out,
clientConfigFilePath: args.outDir,
profile: args.profile,
});
process.once('SIGINT', () => void this.sigIntHandler());
Expand Down Expand Up @@ -95,7 +95,7 @@ export class SandboxCommand
array: false,
choices: Object.values(ClientConfigFormat),
})
.option('out', {
.option('outDir', {
describe:
'A path to directory where config is written. If not provided defaults to current process working directory.',
type: 'string',
Expand Down

0 comments on commit 4fd18b1

Please sign in to comment.