mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-09-09 06:55:58 +00:00
34 lines
983 B
PowerShell
34 lines
983 B
PowerShell
# Usage: scoop reset <app>
|
|
# Summary: Reset an app to resolve conflicts
|
|
# Help: Used to resolve conflicts in favor of a particular app. For example,
|
|
# if you've installed 'python' and 'python27', you can use 'scoop reset' to switch between
|
|
# using one or the other.
|
|
param($app)
|
|
|
|
. "$psscriptroot\..\lib\core.ps1"
|
|
. "$psscriptroot\..\lib\manifest.ps1"
|
|
. "$psscriptroot\..\lib\help.ps1"
|
|
. "$psscriptroot\..\lib\install.ps1"
|
|
. "$psscriptroot\..\lib\versions.ps1"
|
|
. "$psscriptroot\..\lib\config.ps1"
|
|
|
|
reset_aliases
|
|
|
|
if(!$app) { 'ERROR: <app> missing'; my_usage; exit 1 }
|
|
|
|
if(!(installed $app)) { abort "'$app' isn't installed" }
|
|
|
|
$version = current_version $app
|
|
"Resetting $app ($version)."
|
|
|
|
$dir = resolve-path (versiondir $app $version)
|
|
$manifest = installed_manifest $app $version
|
|
|
|
$install = install_info $app $version
|
|
$architecture = $install.architecture
|
|
|
|
$dir = link_current $dir
|
|
create_shims $manifest $dir $false $architecture
|
|
env_add_path $manifest $dir
|
|
env_set $manifest $dir
|