How to use the popd function from shelljs

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

23
24
25
26
27
28
29
30
31
32
  path: `./deployments/devnet-${nextDevnetId}/.env`
})

shell.pushd(`./deployments/devnet-${nextDevnetId}`)
shell.exec(`terraform workspace new devnet-${nextDevnetId}`)
shell.popd()

console.log('📍Executing terraform init...')
shell.exec(`terraform -chdir=./deployments/devnet-${nextDevnetId} init`, {
  env: {
fork icon37
star icon39
watch icon0

100
101
102
103
104
105
106
107
108
109
  launchPackagerInSeparateWindow();

  // launch the app on iOS simulator
  pushd('packages/rn-tester');
  exec('npx react-native run-ios --scheme RNTester --simulator "iPhone 14"');
  popd();
} else {
  // we do the android path here

  launchAndroidEmulator();
fork icon2
star icon0
watch icon0

+ 3 other calls in file

111
112
113
114
115
116
117
118
119
120
121
 * @param {Object} config
 * @returns {Void}
 */
function popdIf(config) {
    if (config.path) {
        Shell.popd("-q");
    }
}


/**
fork icon0
star icon3
watch icon0

+ 3 other calls in file

37
38
39
40
41
42
43
44
45
46
  const mochaString = process.env.CIRCLECI ? `MOCHA_FILE=reports/mocha-${t}.xml ${mocha} --reporter mocha-junit-reporter ${s}` : `${mocha} ${s}`
  const concurrentlyString = `node node_modules/concurrently/dist/bin/concurrently.js --kill-others-on-fail --prefix-colors "dim" --prefix "[{name}]" --names "${type}"`
  return [t, `${concurrentlyString} "${mochaString}"`]
})

sh.popd()
tests = process.env.TEST_SERIES === '1' ?
  tests.map(t => t[1]).join(' && ') :
  tests.fromPairs().value()
if (process.env.CIRCLECI) {
fork icon1
star icon1
watch icon0

75
76
77
78
79
80
81
82
83
84
85
  // Cleanup any previous Rust builds, update deps, and compile
  shell.exec("npm ci --ignore-scripts");
  shell.exec("npm run clean-rs");
  shell.pushd("./native");
  shell.exec("cargo update");
  shell.popd();
  shell.exec("npm run compile");


  shell.echo("BUILDING RUST COMPLETE...");
}
fork icon0
star icon1
watch icon0

67
68
69
70
71
72
73
74
75
76
77
78


if (includeCodeIntelExtensions) {
  shelljs.pushd(rootDirectoryNameForZip)
  shelljs.exec('pnpm install')
  shelljs.exec('pnpm --filter @sourcegraph/browser run build-inline-extensions')
  shelljs.popd()
}


// Copy build script to main dir
shelljs.cp({}, path.join(process.cwd(), 'scripts', buildBashFile), path.join(rootDirectoryNameForZip, buildBashFile))
fork icon930
star icon0
watch icon0

155
156
157
158
159
160
161
162
163
164
  cmd = 'xpm run build'
  shx.echo(`$ ${cmd}`)
  shx.exec(cmd)

  shx.config.silent = true
  shx.popd()
  shx.config.silent = false
}

/**
fork icon0
star icon0
watch icon0

+ 4 other calls in file