From 60d6392e4183843ad773fedbe90f2baa3e3aa0a4 Mon Sep 17 00:00:00 2001 From: Marcus Eide Date: Thu, 16 Apr 2020 15:43:54 +0200 Subject: [PATCH] Add back isTemp check --- packages/cli/bin/backstage-cli | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/cli/bin/backstage-cli b/packages/cli/bin/backstage-cli index 5288f913d9..385911896c 100755 --- a/packages/cli/bin/backstage-cli +++ b/packages/cli/bin/backstage-cli @@ -20,7 +20,10 @@ const path = require('path'); // Figure out whether we're running inside the backstage repo or as an installed dependency const isLocal = require('fs').existsSync(path.resolve(__dirname, '../src')); -if (!isLocal || process.env.BACKSTAGE_E2E_CLI_TEST) { +// This is used for e2e-tests where we create a new app in a tmp folder +const isTemp = path.resolve(__dirname).includes(require('os').tmpdir()); + +if (!isLocal || isTemp || process.env.BACKSTAGE_E2E_CLI_TEST) { // src-relative imports are a pain to get to work with plain tsc compilation, as the // transpiled code will maintain the imports as they are in the source. Which means an // import for `helpers/paths` will start like that in the output, which won't work in NodeJS.