File tree 6 files changed +12
-18
lines changed
6 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
- import { exec } from 'shelljs' ;
9
-
10
8
import { info } from '../utils/console' ;
9
+ import { exec } from '../utils/shelljs' ;
11
10
12
11
import { parseCommitMessage , validateCommitMessage , ValidateCommitMessageOptions } from './validate' ;
13
12
@@ -26,7 +25,7 @@ export function validateCommitRange(range: string) {
26
25
const gitLogFormat = `%s%n%n%b${ randomValueSeparator } ` ;
27
26
28
27
// Retrieve the commits in the provided range.
29
- const result = exec ( `git log --reverse --format=${ gitLogFormat } ${ range } ` , { silent : true } ) ;
28
+ const result = exec ( `git log --reverse --format=${ gitLogFormat } ${ range } ` ) ;
30
29
if ( result . code ) {
31
30
throw new Error ( `Failed to get all commits in the range: \n ${ result . stderr } ` ) ;
32
31
}
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { exec as _exec } from 'shelljs' ;
10
-
11
- import { info } from '../utils/console' ;
9
+ import { exec as _exec } from '../utils/shelljs' ;
12
10
13
11
/**
14
12
* Log the environment variables expected by bazel for stamping.
@@ -32,7 +30,7 @@ export function buildEnvStamp() {
32
30
33
31
/** Run the exec command and return the stdout as a trimmed string. */
34
32
function exec ( cmd : string ) {
35
- return _exec ( cmd , { silent : true } ) . toString ( ) . trim ( ) ;
33
+ return _exec ( cmd ) . trim ( ) ;
36
34
}
37
35
38
36
/** Whether the repo has local changes. */
Original file line number Diff line number Diff line change 8
8
9
9
import { existsSync } from 'fs' ;
10
10
import { dirname , join } from 'path' ;
11
- import { exec } from 'shelljs' ;
12
11
13
12
import { error } from './console' ;
13
+ import { exec } from './shelljs' ;
14
14
import { isTsNodeAvailable } from './ts-node' ;
15
15
16
16
/**
@@ -119,7 +119,7 @@ export function assertNoErrors(errors: string[]) {
119
119
120
120
/** Gets the path of the directory for the repository base. */
121
121
export function getRepoBaseDir ( ) {
122
- const baseRepoDir = exec ( `git rev-parse --show-toplevel` , { silent : true } ) ;
122
+ const baseRepoDir = exec ( `git rev-parse --show-toplevel` ) ;
123
123
if ( baseRepoDir . code ) {
124
124
throw Error (
125
125
`Unable to find the path to the base directory of the repository.\n` +
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { exec } from '../utils /shelljs' ;
9
+ import { exec } from './shelljs' ;
10
10
11
11
12
12
/** Whether the repo has any local changes. */
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { exec } from 'shelljs' ;
10
9
import { getRepoBaseDir } from './config' ;
10
+ import { exec } from './shelljs' ;
11
11
12
12
/**
13
13
* A list of all files currently in the repo which have been modified since the provided sha.
@@ -33,8 +33,5 @@ export function allFiles() {
33
33
34
34
35
35
function gitOutputAsArray ( cmd : string ) {
36
- return exec ( cmd , { cwd : getRepoBaseDir ( ) , silent : true } )
37
- . split ( '\n' )
38
- . map ( x => x . trim ( ) )
39
- . filter ( x => ! ! x ) ;
36
+ return exec ( cmd , { cwd : getRepoBaseDir ( ) } ) . split ( '\n' ) . map ( x => x . trim ( ) ) . filter ( x => ! ! x ) ;
40
37
}
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { exec as _exec , ShellString } from 'shelljs' ;
9
+ import { exec as _exec , ExecOptions , ShellString } from 'shelljs' ;
10
10
11
11
/* Run an exec command as silent. */
12
- export function exec ( cmd : string ) : ShellString {
13
- return _exec ( cmd , { silent : true } ) ;
12
+ export function exec ( cmd : string , opts ?: ExecOptions & { async ?: false } ) : ShellString {
13
+ return _exec ( cmd , { silent : true , ... opts } ) ;
14
14
}
You can’t perform that action at this time.
0 commit comments