From 3babcefce5c0f96a506cd4e261ab2199e1d1b2aa Mon Sep 17 00:00:00 2001 From: Matthew B White Date: Thu, 14 Jun 2018 09:52:11 +0100 Subject: [PATCH] Filesystem wallet promises (#4155) * updates to remove promisification Signed-off-by: Matthew B White * additional promisify removal Signed-off-by: Matthew B White --- packages/composer-common/lib/businessnetworkdefinition.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/composer-common/lib/businessnetworkdefinition.js b/packages/composer-common/lib/businessnetworkdefinition.js index 351e34f81c..2de594b13e 100644 --- a/packages/composer-common/lib/businessnetworkdefinition.js +++ b/packages/composer-common/lib/businessnetworkdefinition.js @@ -29,7 +29,6 @@ const QueryManager = require('./querymanager'); const ScriptManager = require('./scriptmanager'); const semver = require('semver'); const thenify = require('thenify'); -const util = require('util'); const ENCODING = 'utf8'; const LOG = Logger.getLog('BusinessNetworkDefinition'); @@ -717,8 +716,6 @@ class BusinessNetworkDefinition { mode: createFileMode }; - const writeFile = util.promisify(fs.writeFile); - const promises = []; for (let fileEntry of this._getAllArchiveFiles()) { @@ -728,7 +725,7 @@ class BusinessNetworkDefinition { const filePath = fsPath.resolve(directoryPath, ...fileNameParts); const dirname = fsPath.dirname(filePath); const writeFilePromise = mkdirp(dirname, mkdirpOptions) - .then(() => writeFile(filePath, fileContent, writeFileOptions)); + .then(() => fs.writeFileSync(filePath, fileContent, writeFileOptions)); promises.push(writeFilePromise); }