Skip to content

Commit 1ab8e0b

Browse files
FatmeDimitarTachev
authored andcommitted
fix: validate params passed to preview command
1 parent b332669 commit 1ab8e0b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/commands/preview.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export class PreviewCommand implements ICommand {
33
private static MIN_SUPPORTED_WEBPACK_VERSION = "0.17.0";
44

55
constructor(private $bundleValidatorHelper: IBundleValidatorHelper,
6+
private $errors: IErrors,
67
private $liveSyncService: ILiveSyncService,
78
private $networkConnectivityValidator: INetworkConnectivityValidator,
89
private $projectData: IProjectData,
@@ -27,6 +28,10 @@ export class PreviewCommand implements ICommand {
2728
}
2829

2930
public async canExecute(args: string[]): Promise<boolean> {
31+
if (args && args.length) {
32+
this.$errors.fail(`The arguments '${args.join(" ")}' are not valid for the preview command.`);
33+
}
34+
3035
await this.$networkConnectivityValidator.validate();
3136
this.$bundleValidatorHelper.validate(PreviewCommand.MIN_SUPPORTED_WEBPACK_VERSION);
3237
return true;

0 commit comments

Comments
 (0)