mirror of
https://github.com/github/spec-kit.git
synced 2026-01-30 04:32:02 +00:00
Merge pull request #1039 from sgillis/fix-cdpath-issue
Unset CDPATH while getting SCRIPT_DIR
This commit is contained in:
@@ -75,7 +75,7 @@ EOF
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Source common functions
|
# Source common functions
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$SCRIPT_DIR/common.sh"
|
source "$SCRIPT_DIR/common.sh"
|
||||||
|
|
||||||
# Get feature paths and validate branch
|
# Get feature paths and validate branch
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ get_repo_root() {
|
|||||||
git rev-parse --show-toplevel
|
git rev-parse --show-toplevel
|
||||||
else
|
else
|
||||||
# Fall back to script location for non-git repos
|
# Fall back to script location for non-git repos
|
||||||
local script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
local script_dir="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
(cd "$script_dir/../../.." && pwd)
|
(cd "$script_dir/../../.." && pwd)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ clean_branch_name() {
|
|||||||
# Resolve repository root. Prefer git information when available, but fall back
|
# Resolve repository root. Prefer git information when available, but fall back
|
||||||
# to searching for repository markers so the workflow still functions in repositories that
|
# to searching for repository markers so the workflow still functions in repositories that
|
||||||
# were initialised with --no-git.
|
# were initialised with --no-git.
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
if git rev-parse --show-toplevel >/dev/null 2>&1; then
|
if git rev-parse --show-toplevel >/dev/null 2>&1; then
|
||||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ for arg in "$@"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Get script directory and load common functions
|
# Get script directory and load common functions
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$SCRIPT_DIR/common.sh"
|
source "$SCRIPT_DIR/common.sh"
|
||||||
|
|
||||||
# Get all paths and variables from common functions
|
# Get all paths and variables from common functions
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ set -o pipefail
|
|||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
# Get script directory and load common functions
|
# Get script directory and load common functions
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(CDPATH="" cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
source "$SCRIPT_DIR/common.sh"
|
source "$SCRIPT_DIR/common.sh"
|
||||||
|
|
||||||
# Get all paths and variables from common functions
|
# Get all paths and variables from common functions
|
||||||
|
|||||||
Reference in New Issue
Block a user