Repository navigation
Conversation
update_all runs zsh "$ZIM_HOME/zimfw.zsh" unconditionally under set -u, so a shell without ZIM_HOME (a zsh setup that does not use Zim, or one whose .zshenv does not export it) aborts that step with 'ZIM_HOME: unbound variable' while the run still reports success. Move the Zim update into package_managers/zim.sh, like the other package managers, and run it only when ZIM_HOME is set and zimfw.zsh exists.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #285
Problem
scripts/package/update_allruns underset -uand callszsh "$ZIM_HOME/zimfw.zsh"unconditionally. WhenZIM_HOMEis not set, the step aborts withZIM_HOME: unbound variable, and the run still reports that every package was updated.Fix
Move the Zim update into
scripts/package/src/package_managers/zim.sh, like the other package managers, and guard it the same way the other steps are guarded:zim::is_configuredis true only whenZIM_HOMEis set and$ZIM_HOME/zimfw.zshexists.zim::update_allkeeps the existingupgradeandupdatecalls and thelog::fileoutput unchanged.update_allrunszim::is_configured && output::h2 "馃懡 Zim Framework" && zim::update_all, so the step is skipped silently when Zim is not configured.Testing
zsh,log::fileandoutput::answer, underset -euo pipefail:ZIM_HOMEunset:zim::is_configuredis false and nothing aborts (before:unbound variable);ZIM_HOMEset withoutzimfw.zsh:zim::is_configuredis false;ZIM_HOMEset withzimfw.zsh:zim::update_allrunszimfw.zsh upgradethenzimfw.zsh updateand printsDone, the same as before.scripts/self/static_analysisandscripts/self/lintpass.