Skip to content

update_all: Zim step fails with 'ZIM_HOME: unbound variable' when Zim is not configured #285

Open

Description

@hlclarog

Description

dot package update_all (the up alias in many dotfiles) aborts its Zim step with ZIM_HOME: unbound variable when ZIM_HOME is not set, and then reports that every package was updated.

How to reproduce

  1. Use dotly with a shell environment that does not export ZIM_HOME: for example a zsh setup that does not use Zim, or a .zshenv that does not keep the template's export ZIM_HOME=... line.
  2. Run dot package update_all.

Actual behaviour

## 👽 Zim Framework
/home/<user>/.dotfiles/modules/dotly/scripts/package/update_all: line 33: ZIM_HOME: unbound variable

## 🌚 dotly
 > Done

👌 All your packages have been successfully updated

Expected behaviour

When Zim is not configured, the Zim step is skipped silently, like the other package managers that are not installed.

Cause

scripts/package/update_all runs under set -u and calls Zim unconditionally:

output::h2 "👽 Zim Framework" && zsh "$ZIM_HOME/zimfw.zsh" upgrade 2>&1 | log::file "Upgrading Zim" && ...

Every other step is guarded (platform::command_exists brew && ...), but the Zim step has no guard for a missing ZIM_HOME or zimfw.zsh.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions