Skip to content

Commit 294c7d3

Browse files
committed
Fix version and tests
1 parent f57f9e4 commit 294c7d3

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434

3535
- name: Checkout code
3636
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0 # full history for git describe
39+
40+
- name: Fetch tags
41+
run: git fetch --force --prune --tags
3742

3843
- name: Install reconFTW
3944
shell: bash

install.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/bash
22

33
# Safer bash defaults
4-
set -Eeuo pipefail
4+
set -o pipefail
5+
set -E
6+
set +e
57
IFS=$'\n\t'
68

79
# Detect if the script is being run in MacOS with Homebrew Bash
@@ -448,9 +450,14 @@ function check_updates() {
448450
printf "%bRunning: Looking for new reconFTW version%b\n" "$bblue" "$reset"
449451

450452
if { [[ -n "$TIMEOUT_CMD" ]] && $TIMEOUT_CMD 10 git fetch; } || git fetch; then
451-
BRANCH=$(git rev-parse --abbrev-ref HEAD)
452-
HEADHASH=$(git rev-parse HEAD)
453-
UPSTREAMHASH=$(git rev-parse "${BRANCH}@{upstream}")
453+
BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "HEAD")
454+
HEADHASH=$(git rev-parse HEAD 2>/dev/null || true)
455+
# Skip auto-update if no upstream (detached HEAD or no tracking branch)
456+
if ! git rev-parse --abbrev-ref --symbolic-full-name @{u} >/dev/null 2>&1; then
457+
printf "%bNo upstream configured (detached HEAD). Skipping auto-update.%b\n" "$yellow" "$reset"
458+
return 0
459+
fi
460+
UPSTREAMHASH=$(git rev-parse "@{u}")
454461

455462
if [[ $HEADHASH != "$UPSTREAMHASH" ]]; then
456463
if git status --porcelain | grep -q .; then

0 commit comments

Comments
 (0)