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
8 changes: 6 additions & 2 deletions packaging/standalone/install.envsubst
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ get_checksum() {
arch=$3
ext=$4
url="https://github.com/jdx/mise/releases/download/v${version}/SHASUMS256.txt"
current_version="$MISE_CURRENT_VERSION"
current_version="${current_version#v}"
Comment on lines +113 to +114

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

For conciseness, you can combine these two lines into a single line. This is a standard POSIX shell feature.

Suggested change
current_version="$MISE_CURRENT_VERSION"
current_version="${current_version#v}"
current_version="${MISE_CURRENT_VERSION#v}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file is an envsubst template. $MISE_CURRENT_VERSION is substituted literally before the shell runs, so writing ${MISE_CURRENT_VERSION#v} would be expanded into ${v2026.3.9#v}, which breaks. The two-line form captures the substituted value into a local variable first, then strips the prefix.


# For current version use static checksum otherwise
# use checksum from releases
if [ "$version" = "$MISE_CURRENT_VERSION" ]; then
if [ "$version" = "$current_version" ]; then
checksum_linux_x86_64="$MISE_CHECKSUM_LINUX_X86_64"
checksum_linux_x86_64_musl="$MISE_CHECKSUM_LINUX_X86_64_MUSL"
checksum_linux_arm64="$MISE_CHECKSUM_LINUX_ARM64"
Expand Down Expand Up @@ -242,13 +244,15 @@ download_file() {
install_mise() {
version="${MISE_VERSION:-$MISE_CURRENT_VERSION}"
version="${version#v}"
current_version="$MISE_CURRENT_VERSION"
current_version="${current_version#v}"
Comment on lines +247 to +248

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

For conciseness, you can combine these two lines into a single line. This is a standard POSIX shell feature.

Suggested change
current_version="$MISE_CURRENT_VERSION"
current_version="${current_version#v}"
current_version="${MISE_CURRENT_VERSION#v}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same as above — envsubst constraint requires the two-line form.

os="${MISE_INSTALL_OS:-$(get_os)}"
arch="${MISE_INSTALL_ARCH:-$(get_arch)}"
ext="${MISE_INSTALL_EXT:-$(get_ext)}"
install_path="${MISE_INSTALL_PATH:-$HOME/.local/bin/mise}"
install_dir="$(dirname "$install_path")"
install_from_github="${MISE_INSTALL_FROM_GITHUB:-}"
if [ "$version" != "$MISE_CURRENT_VERSION" ] || [ "$install_from_github" = "1" ] || [ "$install_from_github" = "true" ]; then
if [ "$version" != "$current_version" ] || [ "$install_from_github" = "1" ] || [ "$install_from_github" = "true" ]; then
tarball_url="https://github.com/jdx/mise/releases/download/v${version}/mise-v${version}-${os}-${arch}.${ext}"
elif [ -n "${MISE_TARBALL_URL-}" ]; then
tarball_url="$MISE_TARBALL_URL"
Expand Down
Loading