generated from asdf-vm/asdf-plugin-template
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds a set-dotnet-env script for xonsh (#20)
Co-authored-by: Andreas Hartl <[email protected]>
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env xonsh | ||
|
||
def asdf_update_dotnet_home() -> None: | ||
dotnet_path=$(asdf which dotnet).rstrip('\n') | ||
if dotnet_path: | ||
$DOTNET_ROOT=$(dirname $(realpath @(dotnet_path))).rstrip('\n') | ||
dotnet_version=$(dotnet --version).rstrip('\n') | ||
$MSBuildSDKsPath=$DOTNET_ROOT + "/sdk/" + dotnet_version + "/Sdks" | ||
|
||
@events.on_chdir | ||
def update_dotnet_home_on_chdir(olddir, newdir, **kw) -> None: | ||
asdf_update_dotnet_home() | ||
|
||
@events.on_post_init | ||
def update_dotnet_home_on_post_init() -> None: | ||
asdf_update_dotnet_home() |