aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-11 00:56:32 +0800
committerFabio Berger <me@fabioberger.com>2018-05-11 00:56:32 +0800
commit5a73b8a8e66a3b12a526fa44f77a80f6620dc130 (patch)
treec734bf892b41ec948304bc2a0deba0013f904324 /packages
parentda62a0af3bf1b869a89b503d63ecc8db24e8dda8 (diff)
downloaddexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.tar
dexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.tar.gz
dexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.tar.bz2
dexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.tar.lz
dexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.tar.xz
dexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.tar.zst
dexon-sol-tools-5a73b8a8e66a3b12a526fa44f77a80f6620dc130.zip
Replace mkdir with mkdirp so it also created any missing intermediate directories
Diffstat (limited to 'packages')
-rw-r--r--packages/deployer/package.json2
-rw-r--r--packages/deployer/src/utils/compiler.ts2
-rw-r--r--packages/deployer/src/utils/fs_wrapper.ts3
3 files changed, 5 insertions, 2 deletions
diff --git a/packages/deployer/package.json b/packages/deployer/package.json
index 958f96441..10a29e601 100644
--- a/packages/deployer/package.json
+++ b/packages/deployer/package.json
@@ -50,6 +50,7 @@
"@0xproject/dev-utils": "^0.4.1",
"@0xproject/monorepo-scripts": "^0.1.19",
"@0xproject/tslint-config": "^0.4.17",
+ "@types/mkdirp": "^0.5.2",
"@types/require-from-string": "^1.2.0",
"@types/semver": "^5.5.0",
"chai": "^4.0.1",
@@ -79,6 +80,7 @@
"ethereumjs-util": "^5.1.1",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.17.4",
+ "mkdirp": "^0.5.1",
"require-from-string": "^2.0.1",
"semver": "^5.5.0",
"solc": "^0.4.23",
diff --git a/packages/deployer/src/utils/compiler.ts b/packages/deployer/src/utils/compiler.ts
index c571b2581..3731385e2 100644
--- a/packages/deployer/src/utils/compiler.ts
+++ b/packages/deployer/src/utils/compiler.ts
@@ -40,7 +40,7 @@ export async function getContractArtifactIfExistsAsync(
export async function createDirIfDoesNotExistAsync(dirPath: string): Promise<void> {
if (!fsWrapper.doesPathExistSync(dirPath)) {
logUtils.log(`Creating directory at ${dirPath}...`);
- await fsWrapper.mkdirAsync(dirPath);
+ await fsWrapper.mkdirpAsync(dirPath);
}
}
diff --git a/packages/deployer/src/utils/fs_wrapper.ts b/packages/deployer/src/utils/fs_wrapper.ts
index e02c83f27..cc7b06175 100644
--- a/packages/deployer/src/utils/fs_wrapper.ts
+++ b/packages/deployer/src/utils/fs_wrapper.ts
@@ -1,11 +1,12 @@
import { promisify } from '@0xproject/utils';
import * as fs from 'fs';
+import * as mkdirp from 'mkdirp';
export const fsWrapper = {
readdirAsync: promisify<string[]>(fs.readdir),
readFileAsync: promisify<string>(fs.readFile),
writeFileAsync: promisify<undefined>(fs.writeFile),
- mkdirAsync: promisify<undefined>(fs.mkdir),
+ mkdirpAsync: promisify<undefined>(mkdirp),
doesPathExistSync: fs.existsSync,
rmdirSync: fs.rmdirSync,
removeFileAsync: promisify<undefined>(fs.unlink),