Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): add --no-sync option to run #3819

Merged
merged 3 commits into from
Nov 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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