Skip to content

Added unzip to check_dependencies#535

Open
eliaskickbush wants to merge 2 commits into
tfutils:masterfrom
eliaskickbush:feat/add-unzip-dep-check
Open

Added unzip to check_dependencies#535
eliaskickbush wants to merge 2 commits into
tfutils:masterfrom
eliaskickbush:feat/add-unzip-dep-check

Conversation

@eliaskickbush

@eliaskickbush eliaskickbush commented Jun 14, 2026

Copy link
Copy Markdown

Description

This PR adds a check for existence of the unzip binary in check_dependencies to fail early when unzip is not present and give a more explicit error message.

While it's uncommon for systems to not have unzip present, a fresh installation of WSL does not have unzip, at least in my distribution. The current behavior goes as follows:

user@computer:~/Projects/tfenv$ tfenv install 1.15.2
tfenv: Installing Terraform v1.15.2
tfenv: Downloading release tarball from https://releases.hashicorp.com/terraform/1.15.2/terraform_1.15.2_linux_amd64.zip
################################################################################################################################################################################################################################## 100.0%
tfenv: Downloading SHA hash file from https://releases.hashicorp.com/terraform/1.15.2/terraform_1.15.2_SHA256SUMS
tfenv: Not instructed to use Local PGP (/home/elias/.tfenv/use-{gpgv,gnupg}) & No keybase install found, skipping OpenPGP signature verification
tfenv: SHA256 hash matched!
/home/elias/.tfenv/libexec/tfenv-install: line 403: unzip: command not found
tfenv: [ERROR] Tarball unzip failed

With this change, a check runs before attempting to unzip (by the already present check_dependencies). The new user experience is:

user@computer:~/Projects/tfenv$ ./bin/tfenv install 1.15.2
tfenv: [ERROR] unzip is a requirement and your device does not have it. Install unzip using your preferred method.
tfenv: [ERROR] Failed to resolve 1.15.2 version

command is present on sh, so it should be usable in BSD systems. I have however not checked in an actual BSD-based system.

Issue Link

I have not created an issue for this PR.

Testing

  • Ran ./test/run.sh locally and all tests pass
  • Tested on at least one platform (note which below)
  • New tests added for new functionality (if applicable)

Platform tested:

Quality Checklist

  • Shell quoting verified — all variables quoted, braces used
  • Cross-platform considered — BSD vs GNU tool differences
  • No unintended changes to other commands
  • README.md updated (if user-facing change)
  • CHANGELOG.md updated (if notable change)

Disclaimer

This is my first contribution to this project, sorry if something is off standard, I tried to follow the README.md on contributing. Cheers!

@eliaskickbush eliaskickbush requested a review from Zordrak as a code owner June 14, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant