-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shows information about an installed app. - name and description - version and latest version - license (with link to spdx.org) - linked binaries - shows install notes - URL or path to manifest
- Loading branch information
Showing
1 changed file
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Usage: scoop info <app> | ||
# Summary: Display information about an app | ||
param($app) | ||
|
||
. "$psscriptroot\..\lib\buckets.ps1" | ||
. "$psscriptroot\..\lib\core.ps1" | ||
. "$psscriptroot\..\lib\depends.ps1" | ||
. "$psscriptroot\..\lib\help.ps1" | ||
. "$psscriptroot\..\lib\install.ps1" | ||
. "$psscriptroot\..\lib\manifest.ps1" | ||
. "$psscriptroot\..\lib\versions.ps1" | ||
|
||
reset_aliases | ||
|
||
if(!$app) { my_usage; exit 1 } | ||
|
||
$global = installed $app $true | ||
$app, $bucket, $null = app $app | ||
$status = app_status $app $global | ||
$manifest, $bucket = find_manifest $app $bucket | ||
|
||
if (!$manifest) { | ||
if ($bucket) { | ||
abort "Could not find manifest for '$bucket/$app'." | ||
} else { | ||
abort "Could not find manifest for '$app'." | ||
} | ||
} | ||
|
||
$install = install_info $app $status.version $global | ||
$manifest_file = manifest_path $app $bucket | ||
$version_output = $manifest.version | ||
|
||
if($status.installed) { | ||
$bucket = $install.bucket | ||
$manifest_file = manifest_path $app $bucket | ||
if($install.url) { $manifest_file = $install.url } | ||
if($status.version -eq $manifest.version) { | ||
$version_output = $status.version | ||
} else { | ||
$version_output = "$($status.version) (Update to $($manifest.version) available)" | ||
} | ||
} | ||
|
||
Write-Output "Name: $app" | ||
if ($manifest.description) { | ||
Write-Output " $($manifest.description)" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
} | ||
Write-Output "Version: $version_output" | ||
Write-Output "Website: $($manifest.homepage)" | ||
# Show license | ||
if ($manifest.license) { | ||
$license = $manifest.license | ||
if($manifest.license -notmatch '^((ht)|f)tps?://') { | ||
$license = "$($manifest.license) (https://spdx.org/licenses/$($manifest.license).html)" | ||
} | ||
Write-Output "License: $license" | ||
} | ||
|
||
# Show installed versions | ||
if($status.installed) { | ||
Write-Output "Installed:" | ||
$versions = versions $app $global | ||
$versions | ForEach-Object { | ||
$dir = versiondir $app $_ $global | ||
if($global) { $dir += " *global*" } | ||
Write-Output " $dir" | ||
} | ||
Write-Output "Binaries:" | ||
$binaries = arch_specific 'bin' $manifest $install.architecture | ||
Write-Output " $binaries" | ||
} else { | ||
Write-Output "Installed: No" | ||
} | ||
|
||
# Manifest file | ||
Write-Output "Manifest:`n $manifest_file" | ||
|
||
# Show notes | ||
$dir = versiondir 'current' $global | ||
$original_dir = versiondir $app $manifest.version $global | ||
$persist_dir = persistdir $app $global | ||
show_notes $manifest $dir $original_dir $persist_dir | ||
|
||
exit 0 |
Missing
Description:
label. @r15ch13