|
5 | 5 | # TODO: Check OS type and ensure running on windows |
6 | 6 |
|
7 | 7 | $account = "patevs" |
8 | | -$repo = "dotfiles" |
| 8 | +$repo = "pwsh-profile" |
9 | 9 | $branch = "master" |
10 | 10 |
|
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" |
15 | 15 |
|
16 | 16 |
|
17 | 17 | 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 |
26 | 25 | } |
27 | 26 |
|
28 | 27 | function Unzip-File { |
@@ -56,10 +55,10 @@ function Unzip-File { |
56 | 55 | } |
57 | 56 |
|
58 | 57 | 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)} |
60 | 59 | Unzip-File $sourceFile $dotfilesTempDir |
61 | 60 |
|
62 | | -Push-Location "$dotfilesInstallDir\pwsh" |
| 61 | +Push-Location "$pwshProfileInstallDir\pwsh" |
63 | 62 | & .\bootstrap.ps1 |
64 | 63 | Pop-Location |
65 | 64 |
|
|
0 commit comments