mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-09-25 14:56:17 +00:00
Merge pull request #1441 from MartyGentillon/master
Fixed bug where $home doesn't support .endswith
This commit is contained in:
+1
-1
@@ -87,7 +87,7 @@ function fullpath($path) { # should be ~ rooted
|
||||
}
|
||||
function relpath($path) { "$($myinvocation.psscriptroot)\$path" } # relative to calling script
|
||||
function friendly_path($path) {
|
||||
$h = $home; if(!$h.endswith('\')) { $h += '\' }
|
||||
$h = "$env:userprofile"; if(!$h.endswith('\')) { $h += '\' }
|
||||
if($h -eq '\') { return $path }
|
||||
return "$path" -replace ([regex]::escape($h)), "~\"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user