Skip to content

Update install scripts with binst#71

Merged
haya14busa merged 1 commit intomasterfrom
update-installer-script
Sep 3, 2025
Merged

Update install scripts with binst#71
haya14busa merged 1 commit intomasterfrom
update-installer-script

Conversation

@haya14busa
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

shfmt

[shfmt] reported by reviewdog 🐶

done < "$SUMFILE"


[shfmt] reported by reviewdog 🐶

-d) log_set_priority 10 ;;
-h | --help | \?) usage "$0" ;;
-x) set -x ;;
--)
SEPARATOR_FOUND=1
shift
break
;;
-*)
usage "$0"
;;
*)
if [ $SEPARATOR_FOUND -eq 0 ]; then
# First non-flag argument is the tag/version
TAG="$1"
else
TOOL_ARGS="$1 $TOOL_ARGS"
fi
;;


[shfmt] reported by reviewdog 🐶


[shfmt] reported by reviewdog 🐶

if [ "${UNAME_ARCH}" = 'amd64' ] && true
then


[shfmt] reported by reviewdog 🐶

if [ "${UNAME_ARCH}" = '386' ] && true
then


[shfmt] reported by reviewdog 🐶

if [ "${UNAME_OS}" = 'windows' ] && true
then

Comment thread install-nightly.sh
------------------------------------------------------------------------
EOF


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.

[shfmt] reported by reviewdog 🐶

Suggested change

Comment thread install-nightly.sh
hash_sha256 "$1"
}


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.

[shfmt] reported by reviewdog 🐶

Suggested change

Comment thread install-nightly.sh
Comment on lines +186 to +205
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.xz) tar --no-same-owner -xJf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.bz2) tar --no-same-owner -xjf "${tarball}" --strip-components "${strip_components}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" --strip-components "${strip_components}" ;;
*.gz) gunzip "${tarball}" ;;
*.zip)
# unzip doesn't have a standard --strip-components
# Workaround: extract to a subdir and move contents up if stripping
if [ "$strip_components" -gt 0 ]; then
extract_dir=$(basename "${tarball%.zip}")_extracted
unzip -q "${tarball}" -d "${extract_dir}"
# Move contents of the *first* directory found inside extract_dir up
# This assumes wrap_in_directory=true convention
first_subdir=$(find "${extract_dir}" -mindepth 1 -maxdepth 1 -type d -print -quit)
if [ -n "$first_subdir" ]; then
# Move all contents (* includes hidden files)
mv "${first_subdir}"/* .
# Optionally remove the now-empty subdir and the extract_dir
rmdir "${first_subdir}"
rmdir "${extract_dir}"
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.

[shfmt] reported by reviewdog 🐶

Suggested change
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.xz) tar --no-same-owner -xJf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.bz2) tar --no-same-owner -xjf "${tarball}" --strip-components "${strip_components}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" --strip-components "${strip_components}" ;;
*.gz) gunzip "${tarball}" ;;
*.zip)
# unzip doesn't have a standard --strip-components
# Workaround: extract to a subdir and move contents up if stripping
if [ "$strip_components" -gt 0 ]; then
extract_dir=$(basename "${tarball%.zip}")_extracted
unzip -q "${tarball}" -d "${extract_dir}"
# Move contents of the *first* directory found inside extract_dir up
# This assumes wrap_in_directory=true convention
first_subdir=$(find "${extract_dir}" -mindepth 1 -maxdepth 1 -type d -print -quit)
if [ -n "$first_subdir" ]; then
# Move all contents (* includes hidden files)
mv "${first_subdir}"/* .
# Optionally remove the now-empty subdir and the extract_dir
rmdir "${first_subdir}"
rmdir "${extract_dir}"
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.xz) tar --no-same-owner -xJf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.bz2) tar --no-same-owner -xjf "${tarball}" --strip-components "${strip_components}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" --strip-components "${strip_components}" ;;
*.gz) gunzip "${tarball}" ;;
*.zip)
# unzip doesn't have a standard --strip-components
# Workaround: extract to a subdir and move contents up if stripping
if [ "$strip_components" -gt 0 ]; then
extract_dir=$(basename "${tarball%.zip}")_extracted
unzip -q "${tarball}" -d "${extract_dir}"
# Move contents of the *first* directory found inside extract_dir up
# This assumes wrap_in_directory=true convention
first_subdir=$(find "${extract_dir}" -mindepth 1 -maxdepth 1 -type d -print -quit)
if [ -n "$first_subdir" ]; then
# Move all contents (* includes hidden files)
mv "${first_subdir}"/* .
# Optionally remove the now-empty subdir and the extract_dir
rmdir "${first_subdir}"
rmdir "${extract_dir}"
else
log_warn "Could not find subdirectory in zip to strip components from ${extract_dir}"
# Files are extracted in current dir anyway, proceed
fi

Comment thread install-nightly.sh
Comment on lines +207 to +208
log_warn "Could not find subdirectory in zip to strip components from ${extract_dir}"
# Files are extracted in current dir anyway, proceed
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.

[shfmt] reported by reviewdog 🐶

Suggested change
log_warn "Could not find subdirectory in zip to strip components from ${extract_dir}"
# Files are extracted in current dir anyway, proceed
unzip -q "${tarball}"

Comment thread install-nightly.sh
Comment on lines +210 to +217
else
unzip -q "${tarball}"
fi
;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;
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.

[shfmt] reported by reviewdog 🐶

Suggested change
else
unzip -q "${tarball}"
fi
;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;
;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;

Comment thread scripts/binst.sh
hash_sha256 "$1"
}


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.

[shfmt] reported by reviewdog 🐶

Suggested change

Comment thread scripts/binst.sh
Comment on lines +190 to +209
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.xz) tar --no-same-owner -xJf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.bz2) tar --no-same-owner -xjf "${tarball}" --strip-components "${strip_components}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" --strip-components "${strip_components}" ;;
*.gz) gunzip "${tarball}" ;;
*.zip)
# unzip doesn't have a standard --strip-components
# Workaround: extract to a subdir and move contents up if stripping
if [ "$strip_components" -gt 0 ]; then
extract_dir=$(basename "${tarball%.zip}")_extracted
unzip -q "${tarball}" -d "${extract_dir}"
# Move contents of the *first* directory found inside extract_dir up
# This assumes wrap_in_directory=true convention
first_subdir=$(find "${extract_dir}" -mindepth 1 -maxdepth 1 -type d -print -quit)
if [ -n "$first_subdir" ]; then
# Move all contents (* includes hidden files)
mv "${first_subdir}"/* .
# Optionally remove the now-empty subdir and the extract_dir
rmdir "${first_subdir}"
rmdir "${extract_dir}"
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.

[shfmt] reported by reviewdog 🐶

Suggested change
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.xz) tar --no-same-owner -xJf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.bz2) tar --no-same-owner -xjf "${tarball}" --strip-components "${strip_components}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" --strip-components "${strip_components}" ;;
*.gz) gunzip "${tarball}" ;;
*.zip)
# unzip doesn't have a standard --strip-components
# Workaround: extract to a subdir and move contents up if stripping
if [ "$strip_components" -gt 0 ]; then
extract_dir=$(basename "${tarball%.zip}")_extracted
unzip -q "${tarball}" -d "${extract_dir}"
# Move contents of the *first* directory found inside extract_dir up
# This assumes wrap_in_directory=true convention
first_subdir=$(find "${extract_dir}" -mindepth 1 -maxdepth 1 -type d -print -quit)
if [ -n "$first_subdir" ]; then
# Move all contents (* includes hidden files)
mv "${first_subdir}"/* .
# Optionally remove the now-empty subdir and the extract_dir
rmdir "${first_subdir}"
rmdir "${extract_dir}"
*.tar.gz | *.tgz) tar --no-same-owner -xzf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.xz) tar --no-same-owner -xJf "${tarball}" --strip-components "${strip_components}" ;;
*.tar.bz2) tar --no-same-owner -xjf "${tarball}" --strip-components "${strip_components}" ;;
*.tar) tar --no-same-owner -xf "${tarball}" --strip-components "${strip_components}" ;;
*.gz) gunzip "${tarball}" ;;
*.zip)
# unzip doesn't have a standard --strip-components
# Workaround: extract to a subdir and move contents up if stripping
if [ "$strip_components" -gt 0 ]; then
extract_dir=$(basename "${tarball%.zip}")_extracted
unzip -q "${tarball}" -d "${extract_dir}"
# Move contents of the *first* directory found inside extract_dir up
# This assumes wrap_in_directory=true convention
first_subdir=$(find "${extract_dir}" -mindepth 1 -maxdepth 1 -type d -print -quit)
if [ -n "$first_subdir" ]; then
# Move all contents (* includes hidden files)
mv "${first_subdir}"/* .
# Optionally remove the now-empty subdir and the extract_dir
rmdir "${first_subdir}"
rmdir "${extract_dir}"
else
log_warn "Could not find subdirectory in zip to strip components from ${extract_dir}"
# Files are extracted in current dir anyway, proceed
fi

Comment thread scripts/binst.sh
Comment on lines +211 to +212
log_warn "Could not find subdirectory in zip to strip components from ${extract_dir}"
# Files are extracted in current dir anyway, proceed
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.

[shfmt] reported by reviewdog 🐶

Suggested change
log_warn "Could not find subdirectory in zip to strip components from ${extract_dir}"
# Files are extracted in current dir anyway, proceed
unzip -q "${tarball}"

Comment thread scripts/binst.sh
Comment on lines +214 to +221
else
unzip -q "${tarball}"
fi
;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;
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.

[shfmt] reported by reviewdog 🐶

Suggested change
else
unzip -q "${tarball}"
fi
;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;
;;
*)
log_err "untar unknown archive format for ${tarball}"
return 1
;;

Comment thread scripts/binst.sh
Comment on lines +225 to +226


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.

[shfmt] reported by reviewdog 🐶

Suggested change

Comment thread scripts/binst.sh
chmod +x "${BINARY_PATH}"
# Run the binary directly with provided arguments
log_info "Running ${BINARY_NAME}${TOOL_ARGS:+ with arguments:$TOOL_ARGS}"
exec "${BINARY_PATH}" $TOOL_ARGS
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.

[shellcheck (suggestion)] reported by reviewdog 🐶

Suggested change
exec "${BINARY_PATH}" $TOOL_ARGS
exec "${BINARY_PATH}" "$TOOL_ARGS"

@haya14busa haya14busa force-pushed the update-installer-script branch from 85cea3a to 71ad8e7 Compare September 3, 2025 01:40
Comment thread scripts/binst.sh
if [ "$line_filename" = "$BASENAME" ]; then
return 0
fi
done < "$SUMFILE"
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.

[shfmt] reported by reviewdog 🐶

Suggested change
done < "$SUMFILE"
done <"$SUMFILE"

Comment thread scripts/binst.sh
Comment on lines +379 to +397
-d) log_set_priority 10 ;;
-h | --help | \?) usage "$0" ;;
-x) set -x ;;
--)
SEPARATOR_FOUND=1
shift
break
;;
-*)
usage "$0"
;;
*)
if [ $SEPARATOR_FOUND -eq 0 ]; then
# First non-flag argument is the tag/version
TAG="$1"
else
TOOL_ARGS="$1 $TOOL_ARGS"
fi
;;
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.

[shfmt] reported by reviewdog 🐶

Suggested change
-d) log_set_priority 10 ;;
-h | --help | \?) usage "$0" ;;
-x) set -x ;;
--)
SEPARATOR_FOUND=1
shift
break
;;
-*)
usage "$0"
;;
*)
if [ $SEPARATOR_FOUND -eq 0 ]; then
# First non-flag argument is the tag/version
TAG="$1"
else
TOOL_ARGS="$1 $TOOL_ARGS"
fi
;;
-d) log_set_priority 10 ;;
-h | --help | \?) usage "$0" ;;
-x) set -x ;;
--)
SEPARATOR_FOUND=1
shift
break
;;
-*)
usage "$0"
;;
*)
if [ $SEPARATOR_FOUND -eq 0 ]; then
# First non-flag argument is the tag/version
TAG="$1"
else
TOOL_ARGS="$1 $TOOL_ARGS"
fi
;;

Comment thread scripts/binst.sh
log_info "Resolved version: ${VERSION} (tag: ${TAG})"
}


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.

[shfmt] reported by reviewdog 🐶

Suggested change

Comment thread scripts/binst.sh
Comment on lines +443 to +444
if [ "${UNAME_ARCH}" = 'amd64' ] && true
then
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.

[shfmt] reported by reviewdog 🐶

Suggested change
if [ "${UNAME_ARCH}" = 'amd64' ] && true
then
if [ "${UNAME_ARCH}" = 'amd64' ] && true; then

Comment thread scripts/binst.sh
Comment on lines +447 to +448
if [ "${UNAME_ARCH}" = '386' ] && true
then
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.

[shfmt] reported by reviewdog 🐶

Suggested change
if [ "${UNAME_ARCH}" = '386' ] && true
then
if [ "${UNAME_ARCH}" = '386' ] && true; then

Comment thread scripts/binst.sh
Comment on lines +451 to +452
if [ "${UNAME_OS}" = 'windows' ] && true
then
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.

[shfmt] reported by reviewdog 🐶

Suggested change
if [ "${UNAME_OS}" = 'windows' ] && true
then
if [ "${UNAME_OS}" = 'windows' ] && true; then

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 3, 2025

🏷️ [bumpr] Next version:v1.4.0 Changes:v1.3.2...reviewdog:update-installer-script

@haya14busa haya14busa merged commit d8edfce into master Sep 3, 2025
14 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Sep 3, 2025

🚀 [bumpr] Bumped! New version:v1.4.0 Changes:v1.3.2...v1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant