Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix script so it will work on windows #2

Merged
merged 3 commits into from Mar 29, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 11 additions & 12 deletions setup.sh
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should always be dart, doesn't work properly with flutter activate for some reason

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really? it was broken before then?

Copy link
Member

@spydon spydon Mar 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might not have run into the thing where it doesn't work, or it has been fixed, I thought that those two commands would be equivalent, but the flutter one used to cause issues when activating melos before. On their site it also says dart in the instructions. Maybe you could give some insight @Salakar?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not got much thoughts on this sorry, I've always just done dart pub global activate so may be why I've never seen issues

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reply! Maybe it's not even an issue anymore.


if [ "$run_bootstrap" != "false" ]; then
echo 'Running melos bootstrap...'
$exec pub global run melos bootstrap
fi