Skip to content

Commit

Permalink
is_in_dir: return true for checking if a directory is 'in' itself
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesampson committed Nov 11, 2013
1 parent a572724 commit ac8a156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ function dl_urls($app, $version, $manifest, $architecture, $dir) {
$fname # returns the last downloaded file
}

function is_in_dir($dir, $file) {
$file = "$(fullpath $file)"
function is_in_dir($dir, $check) {
$check = "$(fullpath $check)"
$dir = "$(fullpath $dir)"
$file -match "^$([regex]::escape("$dir\"))"
$check -match "^$([regex]::escape("$dir"))(\\|`$)"
}

# hashes
Expand Down

0 comments on commit ac8a156

Please sign in to comment.