File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const EXIT_CODES = {
6
6
SUCCESS : 0 ,
7
7
} ;
8
8
9
- export const CMD_BLACKLIST = [
9
+ export const CMD_BLOCKLIST = [
10
10
'cd' ,
11
11
'pushd' ,
12
12
'popd' ,
@@ -17,7 +17,7 @@ export const CMD_BLACKLIST = [
17
17
'ShellString' ,
18
18
] ;
19
19
20
- export const OPTION_BLACKLIST = [
20
+ export const OPTION_BLOCKLIST = [
21
21
'globOptions' , // we don't have good control over globbing in the shell
22
22
'execPath' , // we don't currently support exec
23
23
'bufLength' , // we don't use buffers in shx
Original file line number Diff line number Diff line change 1
1
import shell from 'shelljs' ;
2
- import { CMD_BLACKLIST , OPTION_BLACKLIST } from './config' ;
2
+ import { CMD_BLOCKLIST , OPTION_BLOCKLIST } from './config' ;
3
3
4
4
// Global options defined directly in shx.
5
5
const locallyDefinedOptions = [ 'version' ] ;
6
6
7
7
const shxOptions = Object . keys ( shell . config )
8
8
. filter ( key => typeof shell . config [ key ] !== 'function' )
9
- . filter ( key => OPTION_BLACKLIST . indexOf ( key ) === - 1 )
9
+ . filter ( key => OPTION_BLOCKLIST . indexOf ( key ) === - 1 )
10
10
. concat ( locallyDefinedOptions )
11
11
. map ( key => ` * --${ key } ` ) ;
12
12
13
13
export default ( ) => {
14
14
// Note: compute this at runtime so that we have all plugins loaded.
15
15
const commandList = Object . keys ( shell )
16
16
. filter ( cmd => typeof shell [ cmd ] === 'function' )
17
- . filter ( cmd => CMD_BLACKLIST . indexOf ( cmd ) === - 1 )
17
+ . filter ( cmd => CMD_BLOCKLIST . indexOf ( cmd ) === - 1 )
18
18
. map ( cmd => ` * ${ cmd } ` ) ;
19
19
20
20
return `
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import minimist from 'minimist';
3
3
import path from 'path' ;
4
4
import fs from 'fs' ;
5
5
import help from './help' ;
6
- import { CMD_BLACKLIST , EXIT_CODES , CONFIG_FILE } from './config' ;
6
+ import { CMD_BLOCKLIST , EXIT_CODES , CONFIG_FILE } from './config' ;
7
7
import { printCmdRet } from './printCmdRet' ;
8
8
9
9
shell . help = help ;
@@ -81,7 +81,7 @@ export function shx(argv) {
81
81
console . error ( `Error: Invalid ShellJS command: ${ fnName } .` ) ;
82
82
console . error ( help ( ) ) ;
83
83
return EXIT_CODES . SHX_ERROR ;
84
- } else if ( CMD_BLACKLIST . indexOf ( fnName ) > - 1 ) {
84
+ } else if ( CMD_BLOCKLIST . indexOf ( fnName ) > - 1 ) {
85
85
console . error ( `Warning: shx ${ fnName } is not supported` ) ;
86
86
console . error ( 'Please run `shx help` for a list of commands.' ) ;
87
87
return EXIT_CODES . SHX_ERROR ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ describe('cli', () => {
73
73
output . code . should . equal ( EXIT_CODES . SHX_ERROR ) ;
74
74
} ) ;
75
75
76
- it ( 'fails for blacklisted commands' , ( ) => {
76
+ it ( 'fails for blocked commands' , ( ) => {
77
77
const output = cli ( 'cd' , 'src' ) ;
78
78
output . stdout . should . equal ( '' ) ;
79
79
output . stderr . should . match ( / W a r n i n g : s h x c d i s n o t s u p p o r t e d \n / ) ;
You can’t perform that action at this time.
0 commit comments