Skip to content
This repository was archived by the owner on Jul 7, 2026. It is now read-only.

Commit bc1467d

Browse files
committed
Make conditional braces consistent
1 parent 8c0e756 commit bc1467d

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

install.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ generate_uuid() {
4848
get_installation_id() {
4949
local identity_file="$HOME/.unpage/.identity"
5050

51-
if [ -f "$identity_file" ]; then
51+
if [[ -f "$identity_file" ]]; then
5252
cat "$identity_file"
5353
else
5454
printf "%s" "$(generate_uuid)"
@@ -68,7 +68,7 @@ persist_installation_id() {
6868
local identity_file="$HOME/.unpage/.identity"
6969

7070
# Don't persist nil UUID (fallback UUID)
71-
if [ "$installation_id" = "$FALLBACK_UUID" ]; then
71+
if [[ "$installation_id" == "$FALLBACK_UUID" ]]; then
7272
return 0
7373
fi
7474

@@ -139,14 +139,14 @@ EOF
139139
# Send the telemetry event (don't let failures break the installer)
140140
local tuna_url="https://tuna.aptible.com/www/e"
141141

142-
if [ "$download_cmd" = "curl" ]; then
142+
if [[ "$download_cmd" == "curl" ]]; then
143143
curl -s -G "$tuna_url" \
144144
--data-urlencode "id=$event_id" \
145145
--data-urlencode "user_id=$INSTALLATION_ID" \
146146
--data-urlencode "type=unpage_telemetry" \
147147
--data-urlencode "url=https://github.com/aptible/unpage" \
148148
--data-urlencode "value=$telemetry_payload" >/dev/null 2>&1 || true
149-
elif [ "$download_cmd" = "wget" ]; then
149+
elif [[ "$download_cmd" == "wget" ]]; then
150150
local encoded_payload
151151
encoded_payload=$(printf '%s' "$telemetry_payload" | sed 's/ /%20/g; s/"/%22/g; s/{/%7B/g; s/}/%7D/g; s/:/%3A/g; s/,/%2C/g' 2>/dev/null || echo "")
152152
local encoded_event_id
@@ -205,19 +205,20 @@ source_uv_env() {
205205

206206
for base_path in "${possible_base_paths[@]}"; do
207207
# Skip empty paths
208-
if [ -z "$base_path" ]; then
208+
if [[ -z "$base_path" ]]; then
209209
continue
210210
fi
211211

212212
# Look for env script in the base directory
213-
if [ -f "$base_path/env" ]; then
213+
if [[ -f "$base_path/env" ]]; then
214214
print_info "Found uv environment script at: $base_path/env"
215+
# shellcheck disable=SC1091
215216
source "$base_path/env"
216217
return 0
217218
fi
218219

219220
# Also check bin subdirectory for uv binary as fallback
220-
if [ -f "$base_path/bin/uv" ] && [ -x "$base_path/bin/uv" ]; then
221+
if [[ -f "$base_path/bin/uv" ]] && [[ -x "$base_path/bin/uv" ]]; then
221222
print_info "Found uv binary at: $base_path/bin/uv (adding to PATH)"
222223
export PATH="$base_path/bin:$PATH"
223224
return 0

0 commit comments

Comments
 (0)