This repository was archived by the owner on Sep 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -597,6 +597,23 @@ function prune_installed($apps) {
597597 $apps | ? { $installed -notcontains $_ }
598598}
599599
600+ # check whether the app failed to install
601+ function failed ($app , $global ) {
602+ $ver = current_version $app
603+ if (! $ver ) { return $false }
604+ $info = install_info $app $ver $global
605+ if (! $info ) { return $true }
606+ return $false
607+ }
608+
609+ function ensure_none_failed ($apps , $global ) {
610+ foreach ($app in $apps ) {
611+ if (failed $app $global ) {
612+ abort " $app install failed previously. please uninstall it and try again."
613+ }
614+ }
615+ }
616+
600617# travelling directories have their contents moved from
601618# $from to $to when the app is updated.
602619# any files or directories that already exist in $to are skipped
Original file line number Diff line number Diff line change @@ -53,8 +53,9 @@ if($global -and !(is_admin)) {
5353
5454ensure_none_installed $apps $global
5555
56- $apps = install_order $apps $architecture
57- $apps = prune_installed $apps $global
56+ $apps = install_order $apps $architecture # adds dependencies
57+ ensure_none_failed $apps $global
58+ $apps = prune_installed $apps $global # removes dependencies that are already installed
5859
5960$apps | % { install_app $_ $architecture $global }
6061
You can’t perform that action at this time.
0 commit comments