Skip to content

fix(zpmod): tailor --reset rebuild message for fresh install vs explicit request #342

@ss-o

Description

@ss-o

Problem

In .zi-module --reset, the rebuild message "recompilation of the zpmod module has been requested…" fires even on a fresh install where no RECOMPILE_REQUEST file exists.

The condition uses ${recompile_request_ts:-1} -gt ${compiled_at_ts:-0}, so when neither file exists the comparison is 1 > 0 → true, triggering a misleading message.

Fix

Gate the full rebuild branch on RECOMPILE_REQUEST actually existing:

if [[ -e ${ZI[ZMODULES_DIR]}/zpmod/RECOMPILE_REQUEST ]] && \
   [[ ${recompile_request_ts:-1} -gt ${compiled_at_ts:-0} ]]; then
  # explicit recompile requested
else
  # first-time or COMPILED_AT absent — build silently or with a different message
fi

For a fresh install with no COMPILED_AT, the --reset path should either skip the prompt or show a neutral "module not yet compiled, building now…" message.

Context

Flagged in PR #341 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions