diff --git a/CHANGELOG.md b/CHANGELOG.md index db3574e275..4a312dcb11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - **hash:** Use `Get-FileHash()` directly ([#5177](https://github.com/ScoopInstaller/Scoop/issues/5177)) - **installer:** Drop the old installer ([#5186](https://github.com/ScoopInstaller/Scoop/issues/5186)) +- **unix:** Remove `unix.ps1` ([#5235](https://github.com/ScoopInstaller/Scoop/issues/5235)) ### Builds diff --git a/bin/auto-pr.ps1 b/bin/auto-pr.ps1 index 71db417a8c..766e49764d 100644 --- a/bin/auto-pr.ps1 +++ b/bin/auto-pr.ps1 @@ -66,7 +66,6 @@ param( . "$PSScriptRoot\..\lib\manifest.ps1" . "$PSScriptRoot\..\lib\json.ps1" -. "$PSScriptRoot\..\lib\unix.ps1" if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) { $Dir = Split-Path $App @@ -92,7 +91,7 @@ Optional options: exit 0 } -if (is_unix) { +if ($IsLinux -or $IsMacOS) { if (!(which hub)) { Write-Host "Please install hub ('brew install hub' or visit: https://hub.github.com/)" -ForegroundColor Yellow exit 1 diff --git a/bin/checkhashes.ps1 b/bin/checkhashes.ps1 index d60d5ac627..c8f9656ac4 100644 --- a/bin/checkhashes.ps1 +++ b/bin/checkhashes.ps1 @@ -47,7 +47,6 @@ param( . "$PSScriptRoot\..\lib\json.ps1" . "$PSScriptRoot\..\lib\versions.ps1" . "$PSScriptRoot\..\lib\install.ps1" -. "$PSScriptRoot\..\lib\unix.ps1" $Dir = Convert-Path $Dir if ($ForceUpdate) { $Update = $true } diff --git a/bin/checkver.ps1 b/bin/checkver.ps1 index aeaf1914ce..56b8c8c987 100644 --- a/bin/checkver.ps1 +++ b/bin/checkver.ps1 @@ -74,7 +74,6 @@ param( . "$PSScriptRoot\..\lib\json.ps1" . "$PSScriptRoot\..\lib\versions.ps1" . "$PSScriptRoot\..\lib\install.ps1" # needed for hash generation -. "$PSScriptRoot\..\lib\unix.ps1" if ($App -ne '*' -and (Test-Path $App -PathType Leaf)) { $Dir = Split-Path $App diff --git a/lib/core.ps1 b/lib/core.ps1 index 3fedb228ee..bc0365eb03 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -1256,10 +1256,10 @@ if ($scoopConfig) { # END NOTE # Scoop root directory -$scoopdir = $env:SCOOP, (get_config ROOT_PATH), "$env:USERPROFILE\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1 +$scoopdir = $env:SCOOP, (get_config ROOT_PATH), "$([System.Environment]::GetFolderPath('UserProfile'))\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1 # Scoop global apps directory -$globaldir = $env:SCOOP_GLOBAL, (get_config GLOBAL_PATH), "$env:ProgramData\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1 +$globaldir = $env:SCOOP_GLOBAL, (get_config GLOBAL_PATH), "$([System.Environment]::GetFolderPath('CommonApplicationData'))\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1 # Scoop cache directory # Note: Setting the SCOOP_CACHE environment variable to use a shared directory diff --git a/lib/unix.ps1 b/lib/unix.ps1 deleted file mode 100644 index a9fdf6cca5..0000000000 --- a/lib/unix.ps1 +++ /dev/null @@ -1,21 +0,0 @@ -# Note: This file is for overwriting global variables and functions to make -# them unix compatible. It has to be imported after everything else! - -function is_unix() { $PSVersionTable.Platform -eq 'Unix' } -function is_mac() { $PSVersionTable.OS.ToLower().StartsWith('darwin') } -function is_linux() { $PSVersionTable.OS.ToLower().StartsWith('linux') } - -if(!(is_unix)) { - return # get the hell outta here -} - -# core.ps1 -$scoopdir = $env:SCOOP, (get_config ROOT_PATH), (Join-Path $env:HOME 'scoop') | Select-Object -First 1 -$globaldir = $env:SCOOP_GLOBAL, (get_config 'GLOBAL_PATH'), '/usr/local/scoop' | Select-Object -First 1 -$cachedir = $env:SCOOP_CACHE, (get_config 'CACHE_PATH'), (Join-Path $scoopdir 'cache') | Select-Object -First 1 - -# core.ps1 -function ensure($dir) { - mkdir -p $dir > $null - return Convert-Path $dir -}