From d0c56400592cdd68a24d4c2a7ee95d7bbe967cd9 Mon Sep 17 00:00:00 2001 From: DominickVale Date: Mon, 8 Nov 2021 11:04:25 +0100 Subject: [PATCH] [bare-expo] Fix start-metro script on Linux --- CONTRIBUTING.md | 2 ++ apps/bare-expo/scripts/start-metro.sh | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c6018fe54f544..a3f8755fda33b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,6 +53,8 @@ Manual smoke tests are included in `apps/native-component-list`, this is a good - iOS: `yarn ios` - Android: `yarn android` + If you are working on a Linux distribution, make sure to set the `TERMINAL` environment variable to your preferred terminal application. (e.g. `export TERMINAL="Konsole"`) + 8. You are now running the `test-suite` app via the `bare-expo` project. The next section explains how you can begin to make changes to SDK packages. > If this didn't work for you as described, please [open an issue.](https://github.com/expo/expo/issues/new/choose) diff --git a/apps/bare-expo/scripts/start-metro.sh b/apps/bare-expo/scripts/start-metro.sh index 81ef1016430dc..d32e4001e96ec 100755 --- a/apps/bare-expo/scripts/start-metro.sh +++ b/apps/bare-expo/scripts/start-metro.sh @@ -21,6 +21,15 @@ yarn start --port ${port} EOF # execute the file in a new command line window chmod 0755 ${commandFile} - open ${commandFile} - + case "$OSTYPE" in + darwin*) + open ${commandFile} + ;; + *) + # Spawns a new terminal window and detaches it + # Assuming the non-standard variable $TERMINAL is set + nohup "$TERMINAL" -e "${commandFile}" /dev/null 2>&1 & + ;; + esac + fi