Skip to content

Commit

Permalink
Merge branch 'develop' into info_cosmetic_error
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored May 17, 2022
2 parents a216c2b + bb5392b commit c6c9e45
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
## [Unreleased](https://github.com/ScoopInstaller/Scoop/compare/master...develop)

### Bug Fixes

- **core:** Load config file before initialization ([#4932](https://github.com/ScoopInstaller/Scoop/issues/4932))
- **depends:** Avoid digits in archive file extension (except for .7z and .001) ([#4915](https://github.com/ScoopInstaller/Scoop/issues/4915))
- **bucket:** Don't check remote URL of non-git buckets ([#4923](https://github.com/ScoopInstaller/Scoop/issues/4923))
- **bucket:** Don't write message OK before bucket is cloned ([#4925](https://github.com/ScoopInstaller/Scoop/issues/4925))
- **shim:** Remove character replacement in .cmd -> .ps1 shims ([#4914](https://github.com/ScoopInstaller/Scoop/issues/4914))
- **scoop-info:** Fix error message when manifest is not found ([#4935](https://github.com/ScoopInstaller/Scoop/issues/4935))

### Documentation
Expand Down
38 changes: 15 additions & 23 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -679,19 +679,11 @@ function shim($path, $global, $name, $arg) {
@(
"@rem $resolved_path",
"@echo off",
"setlocal enabledelayedexpansion",
"set args=%*",
":: replace problem characters in arguments",
"set args=%args:`"='%",
"set args=%args:(=``(%",
"set args=%args:)=``)%",
"set invalid=`"='",
"if !args! == !invalid! ( set args= )",
"where /q pwsh.exe",
"if %errorlevel% equ 0 (",
" pwsh -noprofile -ex unrestricted -file `"$resolved_path`" $arg %args%",
" pwsh -noprofile -ex unrestricted -file `"$resolved_path`" $arg %*",
") else (",
" powershell -noprofile -ex unrestricted -file `"$resolved_path`" $arg %args%",
" powershell -noprofile -ex unrestricted -file `"$resolved_path`" $arg %*",
")"
) -join "`r`n" | Out-UTF8File "$shim.cmd"

Expand Down Expand Up @@ -1109,19 +1101,6 @@ function Out-UTF8File {
# for all communication with api.github.com
Optimize-SecurityProtocol

# Scoop root directory
$scoopdir = $env:SCOOP, (get_config 'rootPath'), "$env:USERPROFILE\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1

# Scoop global apps directory
$globaldir = $env:SCOOP_GLOBAL, (get_config 'globalPath'), "$env:ProgramData\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
# is experimental and untested. There may be concurrency issues when
# multiple users write and access cached files at the same time.
# Use at your own risk.
$cachedir = $env:SCOOP_CACHE, (get_config 'cachePath'), "$scoopdir\cache" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -first 1

# Scoop config file migration
$configHome = $env:XDG_CONFIG_HOME, "$env:USERPROFILE\.config" | Select-Object -First 1
$configFile = "$configHome\scoop\config.json"
Expand All @@ -1135,5 +1114,18 @@ if ((Test-Path "$env:USERPROFILE\.scoop") -and !(Test-Path $configFile)) {
# Load Scoop config
$scoopConfig = load_cfg $configFile

# Scoop root directory
$scoopdir = $env:SCOOP, (get_config 'rootPath'), "$env:USERPROFILE\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1

# Scoop global apps directory
$globaldir = $env:SCOOP_GLOBAL, (get_config 'globalPath'), "$env:ProgramData\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
# is experimental and untested. There may be concurrency issues when
# multiple users write and access cached files at the same time.
# Use at your own risk.
$cachedir = $env:SCOOP_CACHE, (get_config 'cachePath'), "$scoopdir\cache" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -first 1

# Setup proxy globally
setup_proxy

0 comments on commit c6c9e45

Please sign in to comment.