From 5a0e8532b4e3ce776bb15081e1ae7a99ccb9b7d7 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Sat, 26 Mar 2022 18:05:33 -0400 Subject: [PATCH 1/3] Fix script so it will work on windows --- setup.sh | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index e5040cb..6f41d86 100755 --- a/setup.sh +++ b/setup.sh @@ -2,21 +2,20 @@ version=$1 run_bootstrap=$2 -echo Installing Melos $version - -if [ -x "$(command -v flutter)" ] -then - flutter pub global activate melos $version -elif [ -x "$(command -v dart)" ] -then - dart pub global activate melos $version +if [ -x "$(command -v flutter)" ]; then + exec=flutter +elif [ -x "$(command -v dart)" ]; then + exec=dart else echo 'Error: Either dart or flutter needs to be on the PATH.' >&2 exit 1 fi -if [ "$run_bootstrap" != "false" ] -then - echo Running melos bootstrap - melos bootstrap +echo Installing Melos $version via $exec + +$exec pub global activate melos $version + +if [ "$run_bootstrap" != "false" ]; then + echo 'Running melos bootstrap...' + $exec pub global run melos bootstrap fi From a7631f2ec854642697198b64768f1e6a66c22e21 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Sat, 26 Mar 2022 18:51:56 -0400 Subject: [PATCH 2/3] Address comments --- setup.sh | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/setup.sh b/setup.sh index 6f41d86..565a6d6 100755 --- a/setup.sh +++ b/setup.sh @@ -1,21 +1,13 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash -e + version=$1 run_bootstrap=$2 -if [ -x "$(command -v flutter)" ]; then - exec=flutter -elif [ -x "$(command -v dart)" ]; then - exec=dart -else - echo 'Error: Either dart or flutter needs to be on the PATH.' >&2 - exit 1 -fi - -echo Installing Melos $version via $exec +echo Installing Melos $version... -$exec pub global activate melos $version +dart pub global activate melos $version if [ "$run_bootstrap" != "false" ]; then echo 'Running melos bootstrap...' - $exec pub global run melos bootstrap + dart pub global run melos bootstrap fi From d8c7fee611a83425ced8daa08b3357d85de8aad5 Mon Sep 17 00:00:00 2001 From: Luan Nico Date: Sat, 26 Mar 2022 18:52:23 -0400 Subject: [PATCH 3/3] Address comments --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 565a6d6..0daf3d7 100755 --- a/setup.sh +++ b/setup.sh @@ -3,7 +3,7 @@ version=$1 run_bootstrap=$2 -echo Installing Melos $version... +echo "Installing Melos $version..." dart pub global activate melos $version