diff --git a/.gitignore b/.gitignore index 4e902e5..1852549 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ *.pyc -*sln -breakpoints* -update.bat -doit.sh - +*.sln +breakpoints.xml +icons/Thumbs.db diff --git a/tools/pre_commit_bom_check b/tools/pre_commit_bom_check new file mode 100644 index 0000000..49e5080 --- /dev/null +++ b/tools/pre_commit_bom_check @@ -0,0 +1,11 @@ +#! /bin/sh +# move to .git/hooks/pre-commit + +git diff --cached --no-renames --diff-filter=AM --name-only -- '*.py' | +(status=0; while read path; do + if git show ":$path" | head -1 | grep $'^\xEF\xBB\xBF' >/dev/null; then + echo "Error: file '$path' starts with Unicode BOM. Run 'remove_bom.sh $path" then try commit again." + status=1 + fi +done +exit $status) \ No newline at end of file diff --git a/tools/remove_bom.sh b/tools/remove_bom.sh new file mode 100644 index 0000000..e5c7ff7 --- /dev/null +++ b/tools/remove_bom.sh @@ -0,0 +1 @@ +sed -b -i -e "1s/^\xEF\xBB\xBF//" $1 \ No newline at end of file diff --git a/tools/update.bat b/tools/update.bat new file mode 100644 index 0000000..612fe27 --- /dev/null +++ b/tools/update.bat @@ -0,0 +1,2 @@ +robocopy "%userprofile%/repos/web inspector" "%appdata%/sublime text 3/packages/web inspector" /s /xd .git* /xf .git* /xf *st3* /mir +attrib +r "%appdata%/sublime text 3/packages/web inspector/*py" \ No newline at end of file