diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-11 00:56:32 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-11 00:56:32 +0800 |
commit | 5a73b8a8e66a3b12a526fa44f77a80f6620dc130 (patch) | |
tree | c734bf892b41ec948304bc2a0deba0013f904324 | |
parent | da62a0af3bf1b869a89b503d63ecc8db24e8dda8 (diff) | |
download | dexon-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
-rw-r--r-- | packages/deployer/package.json | 2 | ||||
-rw-r--r-- | packages/deployer/src/utils/compiler.ts | 2 | ||||
-rw-r--r-- | packages/deployer/src/utils/fs_wrapper.ts | 3 | ||||
-rw-r--r-- | yarn.lock | 2 |
4 files changed, 6 insertions, 3 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), @@ -255,7 +255,7 @@ version "2.0.29" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" -"@types/mkdirp@^0.5.1": +"@types/mkdirp@^0.5.1", "@types/mkdirp@^0.5.2": version "0.5.2" resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f" dependencies: |