blob: 7562f252f0babd4a6e8a94ef041a4083194e91ca [file] [log] [blame]
# Use this script to bootstrap your Cloud9 environment. This script:
# - Tests SSH connection to GitHub
# - Upgrades to the latest Dart SDK
set +e
echo "Testing connection to GitHub"
ssh -T ""
set -e
# Because GitHub doesn't allow shell access the return code is 1 for success
# and (afaik) 255 for failure.
[ $SSH_RETURN_CODE -ne 1 ] && echo "Connection to GitHub failed" && exit 1
echo "Downloading the latest Dart SDK"
# Enable HTTPS for apt.
sudo apt-get update
sudo apt-get install apt-transport-https
# Get the Google Linux package signing key.
sudo sh -c 'curl | apt-key add -'
# Set up the location of the stable repository.
sudo sh -c 'curl > /etc/apt/sources.list.d/dart_stable.list'
echo "Updating Dart SDK"
sudo apt-get update
sudo apt-get install dart
echo "Add the following to your .bashrc: 'PATH=$PATH:/usr/lib/dart/bin'"
echo "Installing Dart format..."
/usr/lib/dart/bin/pub global activate dart_style
echo "Make sure" `git config` "is registered in your GitHub's Account Settings > Emails."
echo "Make sure" `git config` "is your GitHub user account name."
echo "Make sure to add your Cloud9 SSH key to your GitHub's Account Settings > SSH Keys, which you can find on your Cloud9 Dashboard (look for 'Show your SSH key'."
echo "Done."