File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export const EXIT_CODES = {
66 SUCCESS : 0 ,
77} ;
88
9- export const CMD_BLACKLIST = [
9+ export const CMD_BLOCKLIST = [
1010 'cd' ,
1111 'pushd' ,
1212 'popd' ,
@@ -17,7 +17,7 @@ export const CMD_BLACKLIST = [
1717 'ShellString' ,
1818] ;
1919
20- export const OPTION_BLACKLIST = [
20+ export const OPTION_BLOCKLIST = [
2121 'globOptions' , // we don't have good control over globbing in the shell
2222 'execPath' , // we don't currently support exec
2323 'bufLength' , // we don't use buffers in shx
Original file line number Diff line number Diff line change 11import shell from 'shelljs' ;
2- import { CMD_BLACKLIST , OPTION_BLACKLIST } from './config' ;
2+ import { CMD_BLOCKLIST , OPTION_BLOCKLIST } from './config' ;
33
44// Global options defined directly in shx.
55const locallyDefinedOptions = [ 'version' ] ;
66
77const shxOptions = Object . keys ( shell . config )
88 . filter ( key => typeof shell . config [ key ] !== 'function' )
9- . filter ( key => OPTION_BLACKLIST . indexOf ( key ) === - 1 )
9+ . filter ( key => OPTION_BLOCKLIST . indexOf ( key ) === - 1 )
1010 . concat ( locallyDefinedOptions )
1111 . map ( key => ` * --${ key } ` ) ;
1212
1313export default ( ) => {
1414 // Note: compute this at runtime so that we have all plugins loaded.
1515 const commandList = Object . keys ( shell )
1616 . filter ( cmd => typeof shell [ cmd ] === 'function' )
17- . filter ( cmd => CMD_BLACKLIST . indexOf ( cmd ) === - 1 )
17+ . filter ( cmd => CMD_BLOCKLIST . indexOf ( cmd ) === - 1 )
1818 . map ( cmd => ` * ${ cmd } ` ) ;
1919
2020 return `
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import minimist from 'minimist';
33import path from 'path' ;
44import fs from 'fs' ;
55import help from './help' ;
6- import { CMD_BLACKLIST , EXIT_CODES , CONFIG_FILE } from './config' ;
6+ import { CMD_BLOCKLIST , EXIT_CODES , CONFIG_FILE } from './config' ;
77import { printCmdRet } from './printCmdRet' ;
88
99shell . help = help ;
@@ -81,7 +81,7 @@ export function shx(argv) {
8181 console . error ( `Error: Invalid ShellJS command: ${ fnName } .` ) ;
8282 console . error ( help ( ) ) ;
8383 return EXIT_CODES . SHX_ERROR ;
84- } else if ( CMD_BLACKLIST . indexOf ( fnName ) > - 1 ) {
84+ } else if ( CMD_BLOCKLIST . indexOf ( fnName ) > - 1 ) {
8585 console . error ( `Warning: shx ${ fnName } is not supported` ) ;
8686 console . error ( 'Please run `shx help` for a list of commands.' ) ;
8787 return EXIT_CODES . SHX_ERROR ;
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ describe('cli', () => {
7373 output . code . should . equal ( EXIT_CODES . SHX_ERROR ) ;
7474 } ) ;
7575
76- it ( 'fails for blacklisted commands' , ( ) => {
76+ it ( 'fails for blocked commands' , ( ) => {
7777 const output = cli ( 'cd' , 'src' ) ;
7878 output . stdout . should . equal ( '' ) ;
7979 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