Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
fix(installer): revert merge changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tigattack committed Dec 20, 2021
1 parent 8ae9431 commit 200699b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,19 @@ If ($mentionPreference -ne 1) {
}

# Pull latest version of script from GitHub
Invoke-WebRequest -Uri "https://github.com/tigattack/$project/archive/refs/heads/master.zip" `
-OutFile "$env:TEMP\$project-master.zip"
Invoke-WebRequest -Uri `
"https://github.com/tigattack/$project/releases/download/$latestVersion/$project-$latestVersion.zip" `
-OutFile "$env:TEMP\$project-$latestVersion.zip"

# Unblock downloaded ZIP
Unblock-File -Path "$env:TEMP\$project-master.zip"
Unblock-File -Path "$env:TEMP\$project-$latestVersion.zip"

# Extract release to destination path
Expand-Archive -Path "$env:TEMP\$project-master.zip" -DestinationPath "$rootPath"
Expand-Archive -Path "$env:TEMP\$project-$latestVersion.zip" -DestinationPath "$rootPath"

# Rename destination and tidy up
Rename-Item -Path "$rootPath\$project-master" -NewName "$rootPath\$project"
Remove-Item -Path "$env:TEMP\$project-master.zip"
Rename-Item -Path "$rootPath\$project-$latestVersion" -NewName "$rootPath\$project"
Remove-Item -Path "$env:TEMP\$project-$latestVersion.zip"

# Get config
$config = Get-Content "$rootPath\$project\config\conf.json" -Raw | ConvertFrom-Json
Expand Down

0 comments on commit 200699b

Please sign in to comment.