From: AJ ONeal Date: Sat, 4 Jul 2020 02:48:07 +0000 (+0000) Subject: install ssh-pubkey BEFORE running it X-Git-Url: https://git.josue.xyz/?a=commitdiff_plain;h=4b52c1ba76242bc0e80fa15a37729fe248364343;p=webi-installers%2F.git install ssh-pubkey BEFORE running it --- diff --git a/ssh-pubkey/install.ps1 b/ssh-pubkey/install.ps1 new file mode 100644 index 0000000..b238da7 --- /dev/null +++ b/ssh-pubkey/install.ps1 @@ -0,0 +1,11 @@ +#!/usr/bin/env pwsh + +$MY_CMD = "ssh-pubkey" + +& curl.exe -A "$Env:WEBI_UA" -fsSL "$Env:WEBI_HOST/packages/$MY_CMD/$MY_CMD.ps1" -o "$Env:USERPROFILE\.local\bin\$MY_CMD.ps1.part" +Remove-Item -Path "$Env:USERPROFILE\.local\bin\$MY_CMD.ps1" -Recurse -ErrorAction Ignore +& move "$Env:USERPROFILE\.local\bin\$MY_CMD.ps1.part" "$Env:USERPROFILE\.local\bin\$MY_CMD.ps1" +Set-Content -Path "$Env:USERPROFILE\.local\bin\$MY_CMD.bat" -Value "@echo off`r`npushd %USERPROFILE%`r`npowershell -ExecutionPolicy Bypass .local\bin\$MY_CMD.ps1 %1`r`npopd" + +# run the command +& "$Env:USERPROFILE\.local\bin\$MY_CMD.bat" diff --git a/ssh-pubkey/install.sh b/ssh-pubkey/install.sh new file mode 100644 index 0000000..805f789 --- /dev/null +++ b/ssh-pubkey/install.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +{ + set -e + set -u + + MY_CMD="ssh-pubkey" + + rm -f "$HOME/.local/bin/$MY_CMD" + webi_download "$WEBI_HOST/packages/$MY_CMD/$MY_CMD.sh" "$HOME/.local/bin/$MY_CMD" + chmod a+x "$HOME/.local/bin/$MY_CMD" + + # run the command + "$HOME/.local/bin/$MY_CMD" +}