Skip to content

Commit

Permalink
bash
Browse files Browse the repository at this point in the history
#!/bin/bash
  • Loading branch information
ivanstamenic authored and faniereynders committed Jul 29, 2017
1 parent 5357910 commit 093694e
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions dotnet-sdk
@@ -0,0 +1,46 @@
#!/bin/bash

@echo off

if [%1]==[help] goto help
if [%1]==[] goto help
if [%1]==[list] goto sdk_list
if [%1]==[latest] goto sdk_latest
echo Switching .NET Core SDK version to %1
(
echo {
echo "sdk": {
echo "version": "%1"
echo }
echo }
) > global.json
goto end

:sdk_list
echo The installed .NET Core SDKs are:
dir /b "%programfiles%\dotnet\sdk"
goto end

:sdk_latest
if exist global.json del global.json
echo .NET Core SDK version switched to latest version.
dotnet --version

goto end

:help
echo .NET Core SDK Switcher
echo.
echo Usage: .net sdk [command]
echo Usage: .net sdk [version]
echo.
echo Commands:
echo latest Swtiches to the latest .NET Core SDK version
echo list Lists all installed .NET Core SDKs
echo help Display help
echo.
echo versions:
echo An installed version number of a .NET Core SDK
echo.

:end

0 comments on commit 093694e

Please sign in to comment.