| #!/bin/bash
|
|
|
| FILE="$1"
|
| shift
|
| AUTHOR="Ryan A. Colyer"
|
| YEAR="$(date "+%Y")"
|
| LICENSE="// Created in $YEAR by $AUTHOR.\n// This work is released with CC0 into the public domain.\n// https://creativecommons.org/publicdomain/zero/1.0/"
|
| OPENSCAD="$HOME/src/openscad-master/openscad"
|
|
|
| # Increase the stack to increase OpenSCAD's recursion depth.
|
| ulimit -s 65536
|
|
|
| if [ "$FILE" == "" ]
|
| then
|
| TEMPF=`mktemp --suffix=.scad`
|
| log_scad_mem "$OPENSCAD" "$TEMPF" >/dev/null 2>/dev/null &
|
| vim "$TEMPF"
|
| rm -f "$TEMPF"
|
| exit
|
| fi
|
|
|
| if [ ! -e "$FILE" ]
|
| then
|
| echo -e "$LICENSE" >> "$FILE"
|
| fi
|
|
|
| log_scad_mem "$OPENSCAD" "$FILE" "$@" >/dev/null 2>/dev/null &
|
| vim "$FILE"
|