diff --git a/pwsh/README.md b/pwsh/README.md index eb21e4c..82e712f 100644 --- a/pwsh/README.md +++ b/pwsh/README.md @@ -1,6 +1,6 @@ --- -title: Microsoft PowerShell -homepage: https://docs.microsoft.com/en-us/powershell/ +title: Microsoft PowerShell Core +homepage: https://docs.microsoft.com/powershell/ tagline: | PowerShell Core is a cross-platform (Windows, Linux, and macOS) automation and configuration tool/framework. --- diff --git a/pwsh/install.ps1 b/pwsh/install.ps1 index 995fa5a..79da912 100644 --- a/pwsh/install.ps1 +++ b/pwsh/install.ps1 @@ -1,8 +1,8 @@ #!/usr/bin/env pwsh -################# +################ # Install pwsh # -################# +################ # Every package should define these variables $pkg_cmd_name = "pwsh" @@ -53,4 +53,5 @@ Write-Output " into ${TPath}${pkg_dst}${TReset}" Remove-Item -Path "$pkg_dst" -Recurse -ErrorAction Ignore | Out-Null Copy-Item -Path "$pkg_src" -Destination "$pkg_dst" -Recurse webi_path_add "$pkg_dst_bin" + & "$pkg_dst_cmd" -V diff --git a/pwsh/install.sh b/pwsh/install.sh index 0c261d7..1086d2a 100644 --- a/pwsh/install.sh +++ b/pwsh/install.sh @@ -2,12 +2,18 @@ set -e set -u -__init_powershell() { +__init_pwsh() { pkg_cmd_name="pwsh" - # no ./bin prefix + + # note: no ./bin prefix pkg_src_cmd="$HOME/.local/opt/pwsh-v$WEBI_VERSION/pwsh" + pkg_src_dir="$HOME/.local/opt/pwsh-v$WEBI_VERSION/" + pkg_src="$HOME/.local/opt/pwsh-v$WEBI_VERSION/" + pkg_dst_cmd="$HOME/.local/opt/pwsh/pwsh" + pkg_dst_dir="$HOME/.local/opt/pwsh/" + pkg_dst="$HOME/.local/opt/pwsh/" pkg_get_current_version() { # 'pwsh --version' has output in this format: @@ -22,16 +28,17 @@ __init_powershell() { mkdir -p "$pkg_src" mv ./* "$pkg_src" - # symlink powershell to pwsh + # symlink pwsh as powershell ( cd "$pkg_src" > /dev/null + rm -rf powershell ln -s pwsh powershell ) } pkg_link() { # rm -f "$HOME/.local/opt/pwsh" - rm -f "$pkg_dst" + rm -rf "$pkg_dst" # ln -s "$HOME/.local/opt/pwsh-v7.0.2" "$HOME/.local/opt/pwsh" ln -s "$pkg_src" "$pkg_dst" @@ -43,4 +50,4 @@ __init_powershell() { } } -__init_powershell +__init_pwsh