Skip to content

Instantly share code, notes, and snippets.

@akaleeroy
Last active January 12, 2020 20:06
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
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