Skip to content

Instantly share code, notes, and snippets.

@akaleeroy akaleeroy/pre-commit
Last active Jun 6, 2018

Embed
What would you like to do?
OpenSCAD Export git pre-commit hook
#!/usr/bin/sh
# Requires OpenSCAD on $PATH
# Automatically re-exports all changed .scad files pre-commit
git diff --cached --name-only | grep ".scad$" | while read -r file; do
basename="${file%.*}"
echo "Exporting $file to $basename.stl..."
openscad -o "$basename.stl" "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.