remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/apps/remixdesktop/rundist.bash

42 lines
957 B

2 months ago
#!/bin/bash
# Read the version from package.json
version=$(awk -F'"' '/"version":/ {print $4}' package.json)
4 weeks ago
# Default to false for test_only
test_only=false
# Check for test_only argument
for arg in "$@"; do
if [[ $arg == "test_only" ]]; then
test_only=true
break
fi
done
# Determine the command to run based on the version and test_only flag
if [ "$test_only" = true ]; then
command="yarn dist -c test_only.json"
2 months ago
else
4 weeks ago
if [[ $version == *"beta"* ]]; then
command="yarn dist -c beta.json"
elif [[ $version == *"alpha"* ]]; then
command="yarn dist -c alpha.json"
elif [[ $version == *"insiders"* ]]; then
command="yarn dist -c insiders.json"
else
command="yarn dist -c latest.json"
fi
2 months ago
fi
4 weeks ago
# Append any remaining arguments passed in CLI (except test_only)
2 months ago
for arg in "$@"; do
4 weeks ago
if [[ $arg != "test_only" ]]; then
command+=" $arg"
fi
2 months ago
done
# Print and run the command
echo "Running command: $command"
$command