Skip to content

Commit

Permalink
feat(cli): add --no-sync option to run (#3819)
Browse files Browse the repository at this point in the history
  • Loading branch information
imhoffd committed Nov 18, 2020
1 parent ff45340 commit 8def829
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,10 @@ export async function run(): Promise<void> {
)
.option('--list', 'list targets, then quit')
.option('--target <id>', 'use a specific target')
.action(async (platform, { list, target }) => {
.option('--no-sync', `do not run ${c.input('sync')}`)
.action(async (platform, { list, target, sync }) => {
const { runCommand } = await import('./tasks/run');
await runCommand(config, platform, { list, target });
await runCommand(config, platform, { list, target, sync });
});

program
Expand Down
6 changes: 5 additions & 1 deletion cli/src/tasks/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { sync } from './sync';
export interface RunCommandOptions {
list?: boolean;
target?: string;
sync?: boolean;
}

export async function runCommand(
Expand Down Expand Up @@ -71,7 +72,10 @@ export async function runCommand(
}

try {
await sync(config, platformName, false);
if (options.sync) {
await sync(config, platformName, false);
}

await run(config, platformName, options);
} catch (e) {
logFatal(e.stack ?? e);
Expand Down

0 comments on commit 8def829

Please sign in to comment.