Skip to content

Commit

Permalink
fix: add wait to retrieve, move min wait and default wait to static m…
Browse files Browse the repository at this point in the history
…embers
  • Loading branch information
WillieRuemmele committed Feb 18, 2021
1 parent b1d8b82 commit 74a3cdd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/commands/force/source/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SourceDeployResult } from '@salesforce/source-deploy-retrieve';
import { Duration } from '@salesforce/kit';
import { asString } from '@salesforce/ts-types';
import * as chalk from 'chalk';
import { DEFAULT_SRC_WAIT_MINUTES, MINIMUM_SRC_WAIT_MINUTES, SourceCommand } from '../../../sourceCommand';
import { SourceCommand } from '../../../sourceCommand';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'deploy');
Expand All @@ -30,8 +30,8 @@ export class deploy extends SourceCommand {
}),
wait: flags.minutes({
char: 'w',
default: Duration.minutes(DEFAULT_SRC_WAIT_MINUTES),
min: Duration.minutes(MINIMUM_SRC_WAIT_MINUTES),
default: Duration.minutes(SourceCommand.DEFAULT_SRC_WAIT_MINUTES),
min: Duration.minutes(SourceCommand.MINIMUM_SRC_WAIT_MINUTES),
description: messages.getMessage('flags.wait'),
}),
testlevel: flags.enum({
Expand Down
8 changes: 4 additions & 4 deletions src/commands/force/source/retrieve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SourceRetrieveResult } from '@salesforce/source-deploy-retrieve';
import { Duration } from '@salesforce/kit';
import { asString } from '@salesforce/ts-types';
import { blue, yellow } from 'chalk';
import { DEFAULT_SRC_WAIT_MINUTES, MINIMUM_SRC_WAIT_MINUTES, SourceCommand } from '../../../sourceCommand';
import { SourceCommand } from '../../../sourceCommand';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-source', 'retrieve');
Expand All @@ -30,8 +30,8 @@ export class retrieve extends SourceCommand {
}),
wait: flags.minutes({
char: 'w',
default: Duration.minutes(DEFAULT_SRC_WAIT_MINUTES),
min: MINIMUM_SRC_WAIT_MINUTES,
default: Duration.minutes(SourceCommand.DEFAULT_SRC_WAIT_MINUTES),
min: SourceCommand.MINIMUM_SRC_WAIT_MINUTES,
description: messages.getMessage('flags.wait'),
}),
manifest: flags.filepath({
Expand Down Expand Up @@ -73,7 +73,7 @@ export class retrieve extends SourceCommand {
const results = await cs.retrieve(this.org.getUsername(), path.resolve(defaultPackage.path), {
merge: true,
// TODO: fix this once wait has been updated in library
wait: 1000000,
wait: (this.flags.wait as Duration).milliseconds,
// TODO: implement retrieve via package name
// package: options.packagenames
});
Expand Down
5 changes: 2 additions & 3 deletions src/sourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ export type FlagOptions = {
metadata: string[];
};

export const MINIMUM_SRC_WAIT_MINUTES = 1;
export const DEFAULT_SRC_WAIT_MINUTES = 33;

export abstract class SourceCommand extends SfdxCommand {
public static MINIMUM_SRC_WAIT_MINUTES = 1;
public static DEFAULT_SRC_WAIT_MINUTES = 33;
/**
* will create one ComponentSet to be deployed/retrieved
* will combine from all options passed in
Expand Down

0 comments on commit 74a3cdd

Please sign in to comment.