Skip to content

export/import round-trip fails on an empty GOBIN; remove prints a bare EOF on closed stdin #422

Description

@nao1215

Two gup UX issues found while writing atago E2E coverage against a fake GOBIN. Neither is a crash; both are message/consistency problems.

1. export then import is not a round-trip on an empty GOBIN

mkdir -p /tmp/emptybin /tmp/xdg
GOBIN=/tmp/emptybin XDG_CONFIG_HOME=/tmp/xdg gup export           # WARN + exit 0, writes {"schema_version":1,"packages":[]}
GOBIN=/tmp/emptybin XDG_CONFIG_HOME=/tmp/xdg gup import --dry-run # exit 1: "unable to import package: no package information"

export succeeds (exit 0) and writes a valid, empty gup.json, but importing that same file fails with a generic error. Expected: either import accepts an empty configuration ("nothing to import", exit 0), or export of an empty configuration is itself an error — the two sides should agree. The error also does not name the file it tried to read.

2. remove on stdin EOF prints a bare "gup:ERROR: EOF"

GOBIN=<fake-gobin> gup remove sometool < /dev/null
# "gup:CHECK: remove ...? [Y/n] gup:ERROR: EOF", exit 1 (nothing removed, which is safe)

The confirmation prompt surfaces the raw bufio EOF. Expected: a message with context (e.g. "confirmation aborted: stdin closed") or a non-interactive default of "No". Behavior is safe; only the message is unclear.

Found while writing atago E2E coverage.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions