Skip to content

Commit

Permalink
setup.ps1: Only bootstrap 7zip and OpenedFilesView if not already exp…
Browse files Browse the repository at this point in the history
…orted
  • Loading branch information
MatejKafka committed Apr 2, 2024
1 parent 610b625 commit bb8b694
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,26 @@ if (-not (Test-Path -PathType Leaf $ROOT_FILE_PATH)) {
# now, we should be ready to import Pog
Import-Module $PSScriptRoot\app\Pog

try {
$7z = Get-PogPackage 7zip
} catch {
throw "Could not find the '7zip' package, required for correct functioning of Pog. It should be distributed with Pog itself. " +`
"Please install Pog from a release, not by cloning the repository directly."
return
}
if (-not (Test-Path ([Pog.InternalState]::PathConfig.Path7Zip))) {
try {
$7z = Get-PogPackage 7zip
} catch {
throw "Could not find the '7zip' package, required for correct functioning of Pog. It should be distributed with Pog itself. " +`
"Please install Pog from a release, not by cloning the repository directly."
return
}

try {
$7z | Enable-Pog -PassThru | Export-Pog
} catch {
throw ("Failed to enable the '7zip' package, required for correct functioning of Pog: " + $_)
return
}
try {
$7z | Enable-Pog -PassThru | Export-Pog
} catch {
throw ("Failed to enable the '7zip' package, required for correct functioning of Pog: " + $_)
return
}

if (-not (Test-Path ([Pog.InternalState]::PathConfig.Path7Zip))) {
throw "Setup of '7zip' was successful, but we cannot find the 7z.exe binary that should be provided by the package."
return
if (-not (Test-Path ([Pog.InternalState]::PathConfig.Path7Zip))) {
throw "Setup of '7zip' was successful, but we cannot find the 7z.exe binary that should be provided by the package."
return
}
}

Write-Host ""
Expand Down Expand Up @@ -119,16 +121,18 @@ if (-not (Test-Path $MANIFEST_REPO_PATH)) {
}


try {
pog OpenedFilesView
} catch {
throw ("Failed to install the 'OpenedFilesView' package, required for correct functioning of Pog: " + $_)
return
}

if (-not (Test-Path ([Pog.InternalState]::PathConfig.PathOpenedFilesView))) {
throw "Setup of 'OpenedFilesView' was successful, but we cannot find the OpenedFilesView.exe binary that should be provided by the package."
return
try {
pog OpenedFilesView
} catch {
throw ("Failed to install the 'OpenedFilesView' package, required for correct functioning of Pog: " + $_)
return
}

if (-not (Test-Path ([Pog.InternalState]::PathConfig.PathOpenedFilesView))) {
throw "Setup of 'OpenedFilesView' was successful, but we cannot find the OpenedFilesView.exe binary that should be provided by the package."
return
}
}


Expand Down

0 comments on commit bb8b694

Please sign in to comment.