gbdev / gbdev/rgbenv

_install doesn't handle download failure

Open
#23 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
12
Forks
4
PR merge metrics
No merged PRs in 30d

Description

The _install function will fail pretty messily in case of a number of errors, but particularly in case of the download failing.

https://github.com/gbdev/rgbenv/blob/251577417781a4e8b70da719cf1808e5ecbf6d89/rgbenv#L334-L346

if `$tempfile` is not a valid tarball, i.e. if the download fails:
- `tar -t` will fail
- `$dirname` will be empty, *ideally*
- `tar -x` will fail
- `mv` will fail, trying to move the versions directory into itself
- `cd` will fail
- `make` will be invoked in the version directory, probably "no makefile found" error
- a message will be printed saying that "You may still use this version, just with missing tools."

The most basic thing to add would be checking `tar`'s exit status, which would catch a lot of potential problems.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.