1
1
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2
2
// See LICENSE in the project root for license information.
3
3
4
+ import { CommandLineFlagParameter } from '@rushstack/ts-command-line' ;
5
+
4
6
import { BaseInstallAction } from './BaseInstallAction' ;
5
7
import { IInstallManagerOptions } from '../../logic/base/BaseInstallManager' ;
6
8
import { RushCommandLineParser } from '../RushCommandLineParser' ;
7
9
import { SelectionParameterSet } from '../SelectionParameterSet' ;
8
10
9
11
export class InstallAction extends BaseInstallAction {
12
+ private _checkOnlyParameter ! : CommandLineFlagParameter ;
13
+
10
14
public constructor ( parser : RushCommandLineParser ) {
11
15
super ( {
12
16
actionName : 'install' ,
@@ -33,6 +37,11 @@ export class InstallAction extends BaseInstallAction {
33
37
super . onDefineParameters ( ) ;
34
38
35
39
this . _selectionParameters = new SelectionParameterSet ( this . rushConfiguration , this ) ;
40
+
41
+ this . _checkOnlyParameter = this . defineFlagParameter ( {
42
+ parameterLongName : '--check-only' ,
43
+ description : `Only check the validity of the shrinkwrap file without performing an install.`
44
+ } ) ;
36
45
}
37
46
38
47
protected buildInstallOptions ( ) : IInstallManagerOptions {
@@ -50,7 +59,8 @@ export class InstallAction extends BaseInstallAction {
50
59
// it is safe to assume that the value is not null
51
60
maxInstallAttempts : this . _maxInstallAttempts . value ! ,
52
61
// These are derived independently of the selection for command line brevity
53
- pnpmFilterArguments : this . _selectionParameters ! . getPnpmFilterArguments ( )
62
+ pnpmFilterArguments : this . _selectionParameters ! . getPnpmFilterArguments ( ) ,
63
+ checkOnly : this . _checkOnlyParameter . value
54
64
} ;
55
65
}
56
66
}
0 commit comments