From 2232f61c97a8603cd93cae34565541c8eb300220 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 27 Jul 2016 16:58:30 +0200 Subject: [PATCH] Inline computeDestinationPath into copyAssets ...as we don't need that function to be reusable anymore. We can always extract it later if needed. --- build/lib/compute-destination-path.js | 13 ------------- build/lib/copy-assets.js | 6 +++++- 2 files changed, 5 insertions(+), 14 deletions(-) delete mode 100644 build/lib/compute-destination-path.js diff --git a/build/lib/compute-destination-path.js b/build/lib/compute-destination-path.js deleted file mode 100644 index d79b01198..000000000 --- a/build/lib/compute-destination-path.js +++ /dev/null @@ -1,13 +0,0 @@ -// Takes an absolute path, relativizes it based on the repository root, then -// makes it absolute again in the output app path. - -'use strict' - -const path = require('path') -const CONFIG = require('../config') - -module.exports = -function computeDestinationPath (srcPath) { - let relativePath = path.relative(CONFIG.repositoryRootPath, srcPath) - return path.join(CONFIG.electronAppPath, relativePath) -} diff --git a/build/lib/copy-assets.js b/build/lib/copy-assets.js index 79c401064..a62c52e74 100644 --- a/build/lib/copy-assets.js +++ b/build/lib/copy-assets.js @@ -5,7 +5,6 @@ const path = require('path') const fs = require('fs-extra') -const computeDestinationPath = require('./compute-destination-path') const CONFIG = require('../config') const glob = require('glob') @@ -26,3 +25,8 @@ module.exports = function () { fs.copySync(srcPath, computeDestinationPath(srcPath)) } } + +function computeDestinationPath (srcPath) { + let relativePath = path.relative(CONFIG.repositoryRootPath, srcPath) + return path.join(CONFIG.electronAppPath, relativePath) +}