mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-05-04 08:41:36 +00:00
6d9bca805f
* makes changes to almost all main repo files to be in accordance with .editorconfig * some files in "test\fixtures\..." were left alone to avoid breaking tests * NOTE: whitespace changes *only* (`git diff -b` shows no changes)
47 lines
1.1 KiB
PowerShell
47 lines
1.1 KiB
PowerShell
# Usage: scoop export > filename
|
|
# Summary: Exports (an importable) list of installed apps
|
|
# Help: Lists all installed apps.
|
|
|
|
. "$psscriptroot\..\lib\core.ps1"
|
|
. "$psscriptroot\..\lib\versions.ps1"
|
|
. "$psscriptroot\..\lib\manifest.ps1"
|
|
. "$psscriptroot\..\lib\buckets.ps1"
|
|
|
|
reset_aliases
|
|
|
|
$local = installed_apps $false | % { @{ name = $_; global = $false } }
|
|
$global = installed_apps $true | % { @{ name = $_; global = $true } }
|
|
|
|
$apps = @($local) + @($global)
|
|
$count = 0
|
|
|
|
# json
|
|
# echo "{["
|
|
|
|
if($apps) {
|
|
$apps | sort { $_.name } | ? { !$query -or ($_.name -match $query) } | % {
|
|
$app = $_.name
|
|
$global = $_.global
|
|
$ver = current_version $app $global
|
|
$global_display = $null; if($global) { $global_display = '*global*'}
|
|
|
|
# json
|
|
# $val = "{ 'name': '$app', 'version': '$ver', 'global': $($global.toString().tolower()) }"
|
|
# if($count -gt 0) {
|
|
# " ," + $val
|
|
# } else {
|
|
# " " + $val
|
|
# }
|
|
|
|
# "$app (v:$ver) global:$($global.toString().tolower())"
|
|
"$app (v:$ver) $global_display"
|
|
|
|
$count++
|
|
}
|
|
}
|
|
|
|
# json
|
|
# echo "]}"
|
|
|
|
exit 0
|