Skip to content

bug(cli): upgrade crashes when backup target doesn't exist in --install-dir #793

@rachmlenig

Description

@rachmlenig

Description

lf upgrade --install-dir ~/.local/bin crashes when there's no existing lf binary in the target directory. The upgrade process tries to back up a file that doesn't exist before replacing it.

Expected Behavior

If no existing binary is found in the install directory, skip the backup step and proceed with the install.

Actual Behavior

The upgrade crashes trying to back up a non-existent file.

Workaround

Manually copy the current binary to the target directory before running upgrade:

cp $(which lf) ~/.local/bin/lf
lf upgrade --install-dir ~/.local/bin

Environment

  • OS: Ubuntu (Linux)

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