From 57f6c7899d97c2c8e68692a2d7f3f8ce39c997c7 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Thu, 17 Feb 2022 21:26:28 +0800 Subject: [PATCH] fix broken companion dev #3473 --- bin/companion.js | 2 ++ bin/companion.sh | 6 +----- package.json | 1 + yarn.lock | 8 ++++++++ 4 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 bin/companion.js diff --git a/bin/companion.js b/bin/companion.js new file mode 100644 index 0000000000..aafe0aaf03 --- /dev/null +++ b/bin/companion.js @@ -0,0 +1,2 @@ +require('dotenv').config({ path: '.env.local' }) +require('../packages/@uppy/companion/src/standalone/start-server') diff --git a/bin/companion.sh b/bin/companion.sh index eb647ab17a..50e9576803 100644 --- a/bin/companion.sh +++ b/bin/companion.sh @@ -2,11 +2,7 @@ # Load local env vars. In CI, these are injected. if [ -f .env.local ]; then - # https://gist.github.com/mihow/9c7f559807069a03e302605691f85572?permalink_comment_id=3625310#gistcomment-3625310 - set -a - source <(sed -e '/^#/d;/^\s*$/d' -e "s/'/'\\\''/g" -e "s/=\(.*\)/='\1'/g" .env.local) - set +a - nodemon --watch packages/@uppy/companion/src --exec node ./packages/@uppy/companion/src/standalone/start-server.js + nodemon --watch packages/@uppy/companion/src ./bin/companion.js else env \ COMPANION_DATADIR="./output" \ diff --git a/package.json b/package.json index e3c5a25337..a51628d716 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "core-js": "~3.19.3", "cssnano": "^5.0.6", "dedent": "^0.7.0", + "dotenv": "^16.0.0", "esbuild": "^0.14.1", "esbuild-plugin-babel": "^0.2.3", "eslint": "^8.0.0", diff --git a/yarn.lock b/yarn.lock index 58d211bf02..7cd4e84182 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8538,6 +8538,7 @@ __metadata: core-js: ~3.19.3 cssnano: ^5.0.6 dedent: ^0.7.0 + dotenv: ^16.0.0 esbuild: ^0.14.1 esbuild-plugin-babel: ^0.2.3 eslint: ^8.0.0 @@ -16869,6 +16870,13 @@ __metadata: languageName: node linkType: hard +"dotenv@npm:^16.0.0": + version: 16.0.0 + resolution: "dotenv@npm:16.0.0" + checksum: 664cebb51f0a9a1d1b930f51f0271e72e26d62feaecc9dc03df39453dd494b4e724809ca480fb3ec3213382b1ed3f791aaeb83569a137f9329ce58efd4853dbf + languageName: node + linkType: hard + "dotenv@npm:^7.0.0": version: 7.0.0 resolution: "dotenv@npm:7.0.0"