Skip to content

Commit 2af8b54

Browse files
committed
✨ Updated setup/install.ps1
1 parent e9a2944 commit 2af8b54

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

setup/install.ps1

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,23 @@
55
# TODO: Check OS type and ensure running on windows
66

77
$account = "patevs"
8-
$repo = "dotfiles"
8+
$repo = "pwsh-profile"
99
$branch = "master"
1010

11-
$dotfilesTempDir = Join-Path $env:TEMP "dotfiles"
12-
if (![System.IO.Directory]::Exists($dotfilesTempDir)) {[System.IO.Directory]::CreateDirectory($dotfilesTempDir)}
13-
$sourceFile = Join-Path $dotfilesTempDir "dotfiles.zip"
14-
$dotfilesInstallDir = Join-Path $dotfilesTempDir "$repo-$branch"
11+
$pwshProfileTempDir = Join-Path $env:TEMP "pwsh-profile"
12+
if (![System.IO.Directory]::Exists($pwshProfileTempDir)) {[System.IO.Directory]::CreateDirectory($pwshProfileTempDir)}
13+
$sourceFile = Join-Path $pwshProfileTempDir "pwsh-profile.zip"
14+
$pwshProfileInstallDir = Join-Path $pwshProfileTempDir "$repo-$branch"
1515

1616

1717
function Download-File {
18-
param (
19-
[string]$url,
20-
[string]$file
21-
)
22-
Write-Host "Downloading $url to $file"
23-
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
24-
Invoke-WebRequest -Uri $url -OutFile $file
25-
18+
param (
19+
[string]$url,
20+
[string]$file
21+
)
22+
Write-Host "Downloading $url to $file"
23+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
24+
Invoke-WebRequest -Uri $url -OutFile $file
2625
}
2726

2827
function Unzip-File {
@@ -56,10 +55,10 @@ function Unzip-File {
5655
}
5756

5857
Download-File "https://github.com/$account/$repo/archive/$branch.zip" $sourceFile
59-
if ([System.IO.Directory]::Exists($dotfilesInstallDir)) {[System.IO.Directory]::Delete($dotfilesInstallDir, $true)}
58+
if ([System.IO.Directory]::Exists($pwshProfileInstallDir)) {[System.IO.Directory]::Delete($pwshProfileInstallDir, $true)}
6059
Unzip-File $sourceFile $dotfilesTempDir
6160

62-
Push-Location "$dotfilesInstallDir\pwsh"
61+
Push-Location "$pwshProfileInstallDir\pwsh"
6362
& .\bootstrap.ps1
6463
Pop-Location
6564

0 commit comments

Comments
 (0)