Created
February 20, 2016 02:32
-
-
Save natemcmaster/3a0d5043cc6ca0a6ab2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located | |
done | |
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
set -e | |
export DOTNET_INSTALL_DIR="$DIR/.dotnet" | |
export DOTNET_CLI_PATH="$DOTNET_INSTALL_DIR/share/dotnet/cli" | |
DOTNET="$DOTNET_INSTALL_DIR/share/dotnet/cli/bin/dotnet" | |
if [ ! -e $DOTNET ]; then | |
echo "Installing dotnet-cli" | |
curl -s https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/install.sh | sh -s -- --channel beta | |
fi | |
if [[ tasks/project.json -nt tasks/project.lock.json ]]; then | |
echo "Restoring packages for build tasks" | |
$DOTNET restore tasks/ | |
fi | |
echo "Running build tasks" | |
$DOTNET run --framework dnxcore50 --project "$DIR/tasks" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment