How to use the config function from shelljs

Find comprehensive JavaScript shelljs.config code examples handpicked from public code repositorys.

39
40
41
42
43
44
45
46
47
48
      expect(execSpy).toHaveBeenCalledOnceWith(exampleCommand, jasmine.any(Function));
    });
});

it('should set the shell config to silent if provided, then set to false after execution', () => {
  let { silent } = shell.config;

  execSpy = spyOn(shell, 'exec').and.callFake((command, func) => {
    func(0, { command }, undefined);
  });
fork icon296
star icon149
watch icon42

+ 25 other calls in file

27
28
29
30
31
32
33
34
35
36
const extString = `${extName}_${extVersion}`;

shell.config.silent = true;
let pwd = shell.pwd();
const rootDir = pwd.match(/[^\\|\/]*$/)[0];
shell.config.silent = false;

// beginning the prompts

console.log(`${utils.cepBlock}  Signing ${chalk.blue(extString)}!`);
fork icon4
star icon4
watch icon0

+ 3 other calls in file

122
123
124
125
126
127
128
129
130
131
        }
    }
} else if (isWindows) {
    // Try to auto-detect java in the default install paths.
    var oldSilent = shelljs.config.silent;
    shelljs.config.silent = true;
    var firstJdkDir =
        shelljs.ls(process.env['ProgramFiles'] + '\\java\\jdk*')[0] ||
        shelljs.ls('C:\\Program Files\\java\\jdk*')[0] ||
        shelljs.ls('C:\\Program Files (x86)\\java\\jdk*')[0];
fork icon2
star icon0
watch icon0

+ 5 other calls in file

24
25
26
27
28
29
30
31
32
33
34
}


process.env.TEST_SERIES = '1'
const testTypes = ['commands']
const tests = testTypes.map(type => {
  const {silent} = sh.config
  sh.config.silent = true
  const mocha = 'mocha --forbid-only'
  const base = path.join('test', 'commands')
  sh.pushd(base)
fork icon1
star icon1
watch icon0

+ 2 other calls in file

37
38
39
40
41
42
43
44
45
46
47
    });
    return d.promise;
}


function setShellFatal(value, func) {
    var oldVal = shell.config.fatal;
    shell.config.fatal = value;
    func();
    shell.config.fatal = oldVal;
}
fork icon0
star icon2
watch icon1

+ 29 other calls in file

177
178
179
180
181
182
183
184
185
186
187
  exports.saveYaml(path, swagger, quiet);
  return path;
}


exports.exec = function (cmd, canFail) {
  var glovalVerbose = sh.config.verbose;
  sh.config.verbose = false;
  console.log(cmd);
  var result = sh.exec(cmd, {
    async: false,
fork icon0
star icon0
watch icon5

+ 110 other calls in file

44
45
46
47
48
49
50
51
52
53
54
const fs = require('fs');
const shell = require('shelljs');
const log4js = require('log4js');
const { Octokit } = require('@octokit/rest');
const {getJSON} = require('../util');
// shell.config.silent = true;


const [srcConfigFile, langConfigFile] = process.argv.slice(2);
if (!srcConfigFile) {
  throw new Error('Source config file not provided');
fork icon0
star icon0
watch icon1

+ 4 other calls in file

133
134
135
136
137
138
139
140
141
142
shx.rm('-rf', buildFolder)
shx.mkdir('-p', buildFolder)

shx.config.silent = true
shx.pushd(buildFolder)
shx.config.silent = false

const executableAbsolutePath = path.join(__dirname, executableRelativePath)

let xpmInit = `"${nodeBin}" "${executableAbsolutePath}" --name ${cnt}`
fork icon0
star icon0
watch icon0

+ 19 other calls in file