Skip to content

Commit 05e6108

Browse files
committed
Toolbox: show the intended error message when trying to uninstall unmanaged modules instead of erroring out
1 parent da2e03c commit 05e6108

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

macros/l0.DependencyControl.Toolbox.moon

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,10 @@ uninstall = ->
142142
logger\log msgs.uninstall.running, scriptType, script.name
143143
success, details = DepCtrl(script)\uninstall!
144144
if success == nil
145-
fileList = table.concat ["#{path}: #{res[2]}" for path, res in pairs details when res[1] == nil], "\n"
146-
logger\log msgs.uninstall.error, fileList
145+
if "table" == type details
146+
-- error may be a string or a file list
147+
details = table.concat ["#{path}: #{res[2]}" for path, res in pairs details when res[1] == nil], "\n"
148+
logger\log msgs.uninstall.error, details
147149
else
148150
msg = msgs.uninstall.success\format scriptType, script.name
149151
logger\log if success

0 commit comments

Comments
 (0)