From 083bf8d98b2cdb7af7b53d2f45b86afc91e98413 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Tue, 18 Jun 2019 18:40:05 -0700 Subject: [PATCH] Don't try to convert absolute paths to relative --- shells/browser/chrome/build.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/shells/browser/chrome/build.js b/shells/browser/chrome/build.js index 88c8c9ac18..8bcb863f11 100644 --- a/shells/browser/chrome/build.js +++ b/shells/browser/chrome/build.js @@ -3,7 +3,7 @@ const chalk = require('chalk'); const { execSync } = require('child_process'); const { existsSync } = require('fs'); -const { join, relative } = require('path'); +const { isAbsolute, join, relative } = require('path'); const { argv } = require('yargs'); const build = require('../shared/build'); @@ -21,8 +21,13 @@ const main = async () => { if (crx) { const cwd = join(__dirname, 'build'); - const relativeKeyPath = join(relative(cwd, process.cwd()), keyPath); - execSync(`crx pack ./unpacked -o ReactDevTools.crx -p ${relativeKeyPath}`, { + + let safeKeyPath = keyPath; + if (!isAbsolute(keyPath)) { + safeKeyPath = join(relative(cwd, process.cwd()), keyPath); + } + + execSync(`crx pack ./unpacked -o ReactDevTools.crx -p ${safeKeyPath}`, { cwd, }); }