#!/usr/bin/env bash
set -x
SCRIPT=$(realpath ${BASH_SOURCE[0]})
SCRIPT_PATH=$(dirname ${SCRIPT})
APP_ROOT=$(realpath ${SCRIPT_PATH}/..)

wget 'https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip' -O /tmp/dart-sdk.zip --no-verbose
sudo unzip -o -d /usr/local/ /tmp/dart-sdk.zip
sudo chmod -R a+rx /usr/local/dart-sdk
rm /tmp/dart-sdk.zip
$SCRIPT_PATH/pub.sh update --packages-dir
#!/usr/bin/env bash
set -x
SCRIPT=$(realpath ${BASH_SOURCE[0]})
SCRIPT_PATH=$(dirname ${SCRIPT})
APP_ROOT=$(realpath ${SCRIPT_PATH}/..)

wget 'https://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip' -O /tmp/dart-sdk.zip --no-verbose
sudo unzip -o -d /usr/local/ /tmp/dart-sdk.zip
sudo chmod -R a+rx /usr/local/dart-sdk
rm /tmp/dart-sdk.zip
$SCRIPT_PATH/pub.sh get --packages-dir
Use „pub get“ instead of „pub update“ during install
Use „pub get“ instead of „pub update“ during install

When installing a new VM we better use „pub get“ instead of „pub update“ to fetch dependencies - otherwise it may install incompatible versions because it updates the pubspec.yaml file to the latest version. Updating should only be done only if you are sure you want to update dependencies.
