Last active
January 12, 2020 20:06
-
-
Save akaleeroy/cf011d820b92f527044d2754821aa541 to your computer and use it in GitHub Desktop.
OpenSCAD Export git pre-commit hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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