Skip to content
Open
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
10 changes: 6 additions & 4 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,9 @@ install_binary() {
if user_can_sudo; then
fmt_info "Installing ${BINARY_NAME} to ${target_path} (requires sudo)..."
sudo mkdir -p "$INSTALL_DIR"
sudo cp "$binary_path" "$target_path"
sudo chmod +x "$target_path"
sudo cp "$binary_path" "${target_path}.tmp.$$"
sudo chmod +x "${target_path}.tmp.$$"
sudo mv -f "${target_path}.tmp.$$" "$target_path"
Comment on lines +391 to +393
else
fmt_error "Cannot write to ${INSTALL_DIR} and sudo is not available"
fmt_error "Please run with sudo or choose a different installation directory"
Expand All @@ -398,8 +399,9 @@ install_binary() {
else
fmt_info "Installing ${BINARY_NAME} to ${target_path}..."
mkdir -p "$INSTALL_DIR"
cp "$binary_path" "$target_path"
chmod +x "$target_path"
cp "$binary_path" "${target_path}.tmp.$$"
chmod +x "${target_path}.tmp.$$"
mv -f "${target_path}.tmp.$$" "$target_path"
fi

fmt_success "${BINARY_NAME} installed successfully!"
Expand Down
Loading