Skip to content

Commit

Permalink
Some scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
danmoseley committed Aug 16, 2015
1 parent 4dbbc7d commit 81fa7a6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
*.pyc
*sln
breakpoints*
update.bat
doit.sh

*.sln
breakpoints.xml
icons/Thumbs.db
11 changes: 11 additions & 0 deletions tools/pre_commit_bom_check
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions tools/remove_bom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sed -b -i -e "1s/^\xEF\xBB\xBF//" $1
2 changes: 2 additions & 0 deletions tools/update.bat
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 81fa7a6

Please sign in to comment.