Skip to content

Commit 4e022c9

Browse files
committed
fix: pre-warm sudo credential to avoid multiple prompts, ensure CONFIG_DIR before metadata write
1 parent 39508a8 commit 4e022c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ start_line_spinner() {
1919
return
2020
}
2121
local chars="|/-\\"
22+
# shellcheck disable=SC1003
2223
[[ -z "$chars" ]] && chars='|/-\\'
2324
local i=0
2425
(while true; do
@@ -302,6 +303,7 @@ write_install_channel_metadata() {
302303
local commit_hash="${2:-}"
303304
local metadata_file="$CONFIG_DIR/install_channel"
304305

306+
mkdir -p "$CONFIG_DIR" 2> /dev/null || return 1
305307
local tmp_file
306308
tmp_file=$(mktemp "${CONFIG_DIR}/install_channel.XXXXXX") || return 1
307309
{
@@ -587,6 +589,7 @@ install_files() {
587589
if [[ "$source_dir_abs" != "$install_dir_abs" ]]; then
588590
if needs_sudo; then
589591
log_admin "Admin access required for /usr/local/bin"
592+
sudo -v
590593
fi
591594

592595
# Atomic update: copy to temporary name first, then move

0 commit comments

Comments
 (0)