Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Using mkdir -p for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml committed Aug 9, 2018
1 parent a1771fd commit f20fdca
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/ethWallet-geth.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ const spawnGeth = async () => {
stdio: process.env.GETH_LOG ? 'inherit' : 'ignore'
}

// Ensure geth dir is available
await fs.ensureDir(gethDataDir)

await ensureGethDataDir()
await configurePeers(gethDataDir)

// If the process from the previous browswer session still lingers, it should be killed
Expand All @@ -130,6 +128,14 @@ const spawnGeth = async () => {
console.warn('GETH: spawned')
}

const ensureGethDataDir = async () => {
if (!isWindows) {
await fs.ensureDir(gethDataDir)
} else {
spawn('mkdir', ['-p', gethDataDir])
}
}

const handleGethStop = (event, code, signal) => {
console.warn(`GETH ${event}: Code: ${code} | Signal: ${signal}`)

Expand All @@ -155,7 +161,7 @@ const writeGethPid = async (pid) => {
gethProcessId = pid

try {
await fs.ensureDir(gethDataDir)
await ensureGethDataDir()
await fs.writeFile(pidPath, gethProcessId)
} catch (ex) {
console.error('Could not write geth.pid')
Expand Down

0 comments on commit f20fdca

Please sign in to comment.