Skip to content

Commit

Permalink
smalll tweaks for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
TateB committed Apr 26, 2022
1 parent fd62e73 commit 06df78a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/ens-test-env/src/ens-test-env.default.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = {
forkRpcUrl: 'https://example.com',
graphRpcUrl: 'http://localhost:8545',
secretWords: 'test test test test test test test test test test test junk',
unlockedAccounts: ['0x0000000000000000000000000000000000000000'],
},
archive: {
subgraphId: 'QmXxAE7Urtv6TPa8o8XmPwLVQNbH6r35hRKHP63udTxTNa',
Expand Down
1 change: 1 addition & 0 deletions packages/ens-test-env/src/ganache.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const main = async (config) => {
},
wallet: {
mnemonic: config.docker.secretWords,
unlockedAccounts: config.docker.unlockedAccounts || [],
},
})

Expand Down
16 changes: 12 additions & 4 deletions packages/ens-test-env/src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,22 @@ const killChildren = (cmdName, pid = 0, error) => {
if (cmdName.startsWith('yarn ')) {
cmdName = cmdName.replace('yarn ', 'yarn.*')
}
let children = wrapTry(execSync, `pgrep -f "${cmdName}"`)
let children = wrapTry(execSync, `pgrep -f "${cmdName} || exit 0"`, {
stdio: 'ignore',
})
while (children) {
const child = children
.toString()
.split('\n')
.find((x) => parseInt(x))

if (child) {
const res = wrapTry(execSync, `pgrep -P ${child.trim()}`)
wrapTry(execSync, `${sudopref}kill -9 ${child.trim()}`)
const res = wrapTry(execSync, `pgrep -P ${child.trim()}`, {
stdio: 'ignore',
})
wrapTry(execSync, `${sudopref}kill -9 ${child.trim()} || exit 0`, {
stdio: 'ignore',
})
if (res && !res.toString().includes('No such process')) {
children = res
} else {
Expand All @@ -38,7 +44,9 @@ const killChildren = (cmdName, pid = 0, error) => {
}
}
if (pid) {
wrapTry(execSync, `${sudopref}kill -2 ${pid}`)
wrapTry(execSync, `${sudopref}kill -2 ${pid} || exit 0`, {
stdio: 'ignore',
})
} else {
process.exit(error ? 1 : 0)
}
Expand Down

0 comments on commit 06df78a

Please sign in to comment.