Skip to content

Commit

Permalink
fix(core): Fix is_in_dir under Unix (#5391)
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven authored Feb 19, 2023
1 parent 1d0bd43 commit 32ca856
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- **decompress:** Exclude '*.nsis' that may cause error ([#5294](https://github.com/ScoopInstaller/Scoop/issues/5294))
- **autoupdate:** Fix file hash extraction ([#5295](https://github.com/ScoopInstaller/Scoop/issues/5295))
- **shortcuts:** Output correctly formatted path ([#5333](https://github.com/ScoopInstaller/Scoop/issues/5333))
- **core:** Fix `is_in_dir` under Unix ([#5391](https://github.com/ScoopInstaller/Scoop/issues/5391))

### Code Refactoring

Expand Down
2 changes: 1 addition & 1 deletion lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ function cookie_header($cookies) {
function is_in_dir($dir, $check) {
$check = "$(fullpath $check)"
$dir = "$(fullpath $dir)"
$check -match "^$([regex]::escape("$dir"))(\\|`$)"
$check -match "^$([regex]::Escape("$dir"))([/\\]|`$)"
}

function ftp_file_size($url) {
Expand Down

0 comments on commit 32ca856

Please sign in to comment.