2021-03-20 02:39:59 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-09-14 13:59:19 +02:00
|
|
|
[ "${PISTON_LANGUAGE}" == "fsi" ] && exit 0
|
|
|
|
|
2021-03-20 03:17:55 +01:00
|
|
|
export DOTNET_CLI_HOME=$PWD
|
2021-03-20 03:57:29 +01:00
|
|
|
export HOME=$PWD
|
2021-03-20 03:17:55 +01:00
|
|
|
|
2021-03-20 03:57:29 +01:00
|
|
|
dotnet build --help > /dev/null # Shut the thing up
|
2021-03-20 03:17:55 +01:00
|
|
|
|
2021-09-14 13:59:19 +02:00
|
|
|
case "${PISTON_LANGUAGE}" in
|
|
|
|
basic.net)
|
|
|
|
rename 's/$/\.vb/' "$@" # Add .vb extension
|
|
|
|
dotnet new console -lang VB -o . --no-restore
|
|
|
|
rm Program.vb
|
|
|
|
;;
|
|
|
|
fsharp.net)
|
|
|
|
first_file=$1
|
|
|
|
shift
|
|
|
|
rename 's/$/\.fs/' "$@" # Add .fs extension
|
|
|
|
dotnet new console -lang F# -o . --no-restore
|
|
|
|
mv $first_file Program.fs # For some reason F#.net doesn't work unless the file name is Program.fs
|
|
|
|
;;
|
|
|
|
csharp.net)
|
|
|
|
rename 's/$/\.cs/' "$@" # Add .cs extension
|
|
|
|
dotnet new console -o . --no-restore
|
|
|
|
rm Program.cs
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "How did you get here? (${PISTON_LANGUAGE})"
|
|
|
|
exit 1
|
|
|
|
;;
|
2021-03-20 03:17:55 +01:00
|
|
|
|
2021-09-14 13:59:19 +02:00
|
|
|
esac
|
2021-04-24 09:44:50 +02:00
|
|
|
|
2021-03-20 03:17:55 +01:00
|
|
|
dotnet restore --source $DOTNET_ROOT/.nuget/packages
|
2021-09-14 13:59:19 +02:00
|
|
|
dotnet build --no-restore
|