Skip to content

Commit

Permalink
Fix Standalone and Source detection
Browse files Browse the repository at this point in the history
  • Loading branch information
HUMORCE committed Sep 20, 2024
1 parent c38fc63 commit 58a5ead
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/manifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function Get-Manifest($app) {
if (Test-Path $app) {
$url = Convert-Path $app
$app = appname_from_url $url
$manifest = url_manifest $url
$manifest = parse_json $url
} else {
if (($app -match '\\/') -or $app.EndsWith('.json')) { $url = $app }
$app = appname_from_url $app
Expand Down
19 changes: 11 additions & 8 deletions libexec/scoop-info.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,22 @@ $manifest_file = if ($bucket) {
$url
}

if ($install.url -and (Test-Path $original_app) -or ($original_app -match '^(ht|f)tps?://|\\\\')) {
# Standalone and Source detection
if ((Test-Path $original_app) -or ($original_app -match '^(ht|f)tps?://|\\\\')) {
$standalone = $true
if (Test-Path $original_app) {
$original_app = (Get-AbsolutePath "$original_app")
}
if (Test-Path $install.url) {
$install_url = (Get-AbsolutePath $install.url)
} else {
$install_url = $install.url
if ($install.url) {
if (Test-Path $install.url) {
$install_url = (Get-AbsolutePath $install.url)
} else {
$install_url = $install.url
}
}
if ($original_app -eq $install_url) {
$same_source = $true
}
}
if ($original_app -eq $install_url) {
$same_source = $true
}

if ($verbose) {
Expand Down

0 comments on commit 58a5ead

Please sign in to comment.