diff --git a/scripts/bitwarden.ps1 b/scripts/bitwarden.ps1 index c6e62509a5..24dfd7001e 100644 --- a/scripts/bitwarden.ps1 +++ b/scripts/bitwarden.ps1 @@ -29,7 +29,7 @@ https://bitwarden.com, https://github.com/bitwarden # Setup -$scriptName = $MyInvocation.MyCommand.Name +$scriptPath = $MyInvocation.MyCommand.Path $dir = Split-Path -Parent $MyInvocation.MyCommand.Path if($output -eq "") { $output="${dir}\bitwarden" @@ -50,7 +50,7 @@ if(!(Test-Path -Path $scriptsDir)) { # Functions function Download-Self { - Invoke-RestMethod -OutFile $scriptsDir\$scriptName -Uri "${githubBaseUrl}/scripts/bitwarden.ps1" + Invoke-RestMethod -OutFile $scriptPath -Uri "${githubBaseUrl}/scripts/bitwarden.ps1" } function Download-Install { diff --git a/scripts/bitwarden.sh b/scripts/bitwarden.sh index 13e3e00f2d..443e2ef3ae 100755 --- a/scripts/bitwarden.sh +++ b/scripts/bitwarden.sh @@ -21,8 +21,9 @@ EOF # Setup -SCRIPT_NAME=`basename "$0"` DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +SCRIPT_NAME=`basename "$0"` +SCRIPT_PATH="$DIR/$SCRIPT_NAME" OUTPUT="$DIR/bitwarden" if [ $# -eq 2 ] then @@ -52,8 +53,8 @@ fi # Functions function downloadSelf() { - curl -s -o $SCRIPTS_DIR/$SCRIPT_NAME $GITHUB_BASE_URL/scripts/bitwarden.sh - chmod u+x $SCRIPTS_DIR/$SCRIPT_NAME + curl -s -o $SCRIPT_PATH $GITHUB_BASE_URL/scripts/bitwarden.sh + chmod u+x $SCRIPT_PATH } function downloadInstall() {