File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 62
62
files_to_check=$( git diff --cached --name-only --diff-filter=ACM)
63
63
fi
64
64
65
+ # On cygwin/windows, puppet is a symlink to native puppet install, which needs windows paths.
66
+ if [ " $OSTYPE " == " cygwin" ] && file -L $( which puppet) 2> /dev/null | grep -q ' DOS batch file' && type cygpath > /dev/null 2>&1 ; then
67
+ USE_NATIVE=" YES"
68
+ fi
65
69
for changedfile in $files_to_check ; do
66
70
[[ -f " $changedfile " ]] || continue
71
+ if [ " $USE_NATIVE " == " YES" ]; then
72
+ changedfile_native=" ` cygpath -w " $changedfile " ` "
73
+ else
74
+ changedfile_native=" $changedfile "
75
+ fi
67
76
# check puppet manifest syntax
68
77
if type puppet > /dev/null 2>&1 ; then
69
78
if [[ $( echo " $changedfile " | grep -q ' \.*\.epp$' ; echo $? ) -eq 0 ]]; then
@@ -73,7 +82,7 @@ for changedfile in $files_to_check; do
73
82
failures=$(( failures + 1 ))
74
83
fi
75
84
elif [[ $( echo " $changedfile " | grep -q ' \.*\.pp$' ; echo $? ) -eq 0 ]]; then
76
- ${subhook_root} /puppet_manifest_syntax_check.sh " $changedfile " " " " $USE_PUPPET_FUTURE_PARSER "
85
+ ${subhook_root} /puppet_manifest_syntax_check.sh " $changedfile_native " " " " $USE_PUPPET_FUTURE_PARSER "
77
86
RC=$?
78
87
if [[ " $RC " -ne 0 ]]; then
79
88
failures=$(( failures + 1 ))
You can’t perform that action at this time.
0 commit comments