diff --git a/scripts/bitwarden.ps1 b/scripts/bitwarden.ps1 index 934565991..15873aeda 100644 --- a/scripts/bitwarden.ps1 +++ b/scripts/bitwarden.ps1 @@ -65,7 +65,7 @@ function Check-Output-Dir-Exists { } function Check-Output-Dir-Not-Exists { - if (Test-Path -Path $output) { + if (Test-Path -Path "$output\docker") { throw "Looks like Bitwarden is already installed at $output." } } @@ -74,7 +74,7 @@ function Check-Output-Dir-Not-Exists { if ($install) { Check-Output-Dir-Not-Exists - New-Item -ItemType directory -Path $output | Out-Null + New-Item -ItemType directory -Path $output -ErrorAction Ignore | Out-Null Download-Run-File Invoke-Expression "$scriptsDir\run.ps1 -install -outputDir $output -coreVersion $coreVersion -webVersion $webVersion" } diff --git a/scripts/bitwarden.sh b/scripts/bitwarden.sh index 4cc56082d..b86051676 100755 --- a/scripts/bitwarden.sh +++ b/scripts/bitwarden.sh @@ -66,7 +66,7 @@ function checkOutputDirExists() { } function checkOutputDirNotExists() { - if [ -d "$OUTPUT" ] + if [ -d "$OUTPUT/docker" ] then echo "Looks like Bitwarden is already installed at $OUTPUT." exit 1 @@ -78,7 +78,7 @@ function checkOutputDirNotExists() { if [ "$1" == "install" ] then checkOutputDirNotExists - mkdir $OUTPUT + mkdir -p $OUTPUT downloadRunFile $SCRIPTS_DIR/run.sh install $OUTPUT $COREVERSION $WEBVERSION elif [ "$1" == "start" -o "$1" == "restart" ]