@@ -30,9 +30,8 @@ export const {
3030 test, error,
3131 cat, sed, grep, sort, head, tail, uniq,
3232 which,
33- exit, env, set,
34- exec,
35- config
33+ exit, env,
34+ exec
3635} = shelljs ;
3736/**
3837 * Silent execution of {@link exec} to be used with pipeing or as variable.
@@ -47,6 +46,25 @@ export function exec$(command, options= {}){
4746 return exec ( command , Object . assign ( { } , options , { async : false , silent : true } ) ) . replace ( / \n $ / g, "" ) ;
4847}
4948
49+ const _config = shelljs . config ;
50+ export const config = {
51+ /** Will print each executed command to the screen.
52+ * @default false
53+ */
54+ get verbose ( ) { return _config . verbose ; } ,
55+ set verbose ( v ) { return ( _config . verbose = v ) ; } ,
56+ /** If true the script will die on errors. Default is false. */
57+ get fatal ( ) { return _config . fatal ; } ,
58+ set fatal ( v ) { return ( _config . fatal = v ) ; } ,
59+ /** Disable filename expansion (globbing) */
60+ get noglob ( ) { return _config . noglob ; } ,
61+ set noglob ( v ) { return ( _config . noglob = v ) ; } ,
62+ /** Set multiple options with one command.
63+ * @param {...Record<"verbose"|"fatal"|"noglob",boolean> } c
64+ * */
65+ assign ( ...c ) { return Object . assign ( this , ...c ) ; }
66+ } ;
67+
5068import chalk from "chalk" ;
5169export { chalk , chalk as s } ;
5270
0 commit comments