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 6262 files_to_check=$( git diff --cached --name-only --diff-filter=ACM)
6363fi
6464
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
6569for changedfile in $files_to_check ; do
6670 [[ -f " $changedfile " ]] || continue
71+ if [ " $USE_NATIVE " == " YES" ]; then
72+ changedfile_native=" ` cygpath -w " $changedfile " ` "
73+ else
74+ changedfile_native=" $changedfile "
75+ fi
6776 # check puppet manifest syntax
6877 if type puppet > /dev/null 2>&1 ; then
6978 if [[ $( echo " $changedfile " | grep -q ' \.*\.epp$' ; echo $? ) -eq 0 ]]; then
@@ -73,7 +82,7 @@ for changedfile in $files_to_check; do
7382 failures=$(( failures + 1 ))
7483 fi
7584 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 "
7786 RC=$?
7887 if [[ " $RC " -ne 0 ]]; then
7988 failures=$(( failures + 1 ))
You can’t perform that action at this time.
0 commit comments