Skip to content

Instantly share code, notes, and snippets.

Last active January 12, 2020 20:06
What would you like to do?
OpenSCAD Export git pre-commit hook
# 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
echo "Exporting $file to $basename.stl..."
openscad -o "$basename.stl" "$file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment