configure-precommit 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/configure-precommit +11 -6
- package/package.json +1 -1
package/bin/configure-precommit
CHANGED
|
@@ -15,8 +15,14 @@ YELLOW='\033[0;33m'
|
|
|
15
15
|
CYAN='\033[0;36m'
|
|
16
16
|
NC='\033[0m'
|
|
17
17
|
|
|
18
|
-
# Get the directory where this script is located
|
|
19
|
-
|
|
18
|
+
# Get the directory where this script is located (resolving symlinks)
|
|
19
|
+
SOURCE="${BASH_SOURCE[0]}"
|
|
20
|
+
while [ -L "$SOURCE" ]; do
|
|
21
|
+
DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
22
|
+
SOURCE="$(readlink "$SOURCE")"
|
|
23
|
+
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
|
|
24
|
+
done
|
|
25
|
+
SCRIPT_DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
|
|
20
26
|
PACKAGE_ROOT="$(dirname "$SCRIPT_DIR")"
|
|
21
27
|
|
|
22
28
|
# Version from package.json
|
|
@@ -97,12 +103,11 @@ check_dependencies() {
|
|
|
97
103
|
check_dep "curl" "brew install curl (macOS) or apt install curl (Linux)" || ((missing++))
|
|
98
104
|
check_dep "python3" "brew install python3 (macOS) or apt install python3 (Linux)" || ((missing++))
|
|
99
105
|
|
|
100
|
-
# Check for PyYAML
|
|
106
|
+
# Check for PyYAML (optional - script has fallback)
|
|
101
107
|
if command -v python3 &>/dev/null; then
|
|
102
108
|
if ! python3 -c "import yaml" 2>/dev/null; then
|
|
103
|
-
echo -e "${
|
|
104
|
-
echo -e "
|
|
105
|
-
((missing++))
|
|
109
|
+
echo -e "${YELLOW}[WARN]${NC} PyYAML not installed (optional)"
|
|
110
|
+
echo -e " For better YAML validation: ${CYAN}pip3 install pyyaml${NC}"
|
|
106
111
|
fi
|
|
107
112
|
fi
|
|
108
113
|
|