summaryrefslogtreecommitdiff
path: root/trunk/reprap/miscellaneous/python-beanshell-scripts/runskeinforge.sh
blob: 6c165a1bec8027939307d18fb1e77b95ec8aedfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

#
# Utility script for keeping track of which preference settings a file was processed
# with, by copying the current preferences to a date-tagged directory together
# with the output files.
#
# Usage: runskeinforge.sh <model.gts>
#

dir=`dirname $1`
file=`basename $1`

for s in .gts .GTS .stl .STL; do
  if [ ! `basename $file $s` = $file ]; then suffix=$s; fi
done

if [ -n $suffix ]; then
  filename=`basename $file $suffix`
  newdir=$filename-`date +%m%d%H%M`
  mkdir -p $newdir/skeinforge-prefs
  cp $1 $newdir
  cp ~/.skeinforge/*.csv $newdir/skeinforge-prefs
  python skeinforge.py $newdir/$filename$suffix
  echo $PWD/$newdir/${filename}_export.gcode
fi