Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packaging/standalone/install.envsubst
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,11 @@ install_mise() {
cd "$(dirname "$cache_file")" && get_checksum "$version" "$os" "$arch" "$ext" | "$(shasum_bin)" -c >/dev/null

# extract tarball
if [ -d "$install_path" ]; then
error "MISE_INSTALL_PATH '$install_path' is a directory. Please set it to a file path, e.g. '$install_path/mise'."
fi
Comment on lines +267 to +269

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This check is a great addition to prevent accidental data loss. For a better user experience and to avoid unnecessary network operations, consider moving this validation logic to earlier in the install_mise function. A good place would be right after install_path is defined (around line 248), so the script can fail fast before it downloads and verifies the tarball.

mkdir -p "$install_dir"
rm -rf "$install_path"
rm -f "$install_path"
extract_dir="$(mktemp -d)"
cd "$extract_dir"
if [ "$ext" = "tar.zst" ] && ! tar_supports_zstd; then
Expand Down
Loading