Skip to content

Instantly share code, notes, and snippets.

@anastasiia-kornilova
Last active February 9, 2021 10:47
Show Gist options
  • Save anastasiia-kornilova/f13a708562debabeeb126381f3d535e5 to your computer and use it in GitHub Desktop.
Save anastasiia-kornilova/f13a708562debabeeb126381f3d535e5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Usage: unix_scr.sh <path to fields dir> <path to js file>
TRIK_DIR=${0%/*}
FIELDS_PATH=$1
DEFAULT_PROJECT=$FIELDS_PATH/1.qrs
if [ -f "$DEFAULT_PROJECT" ]; then
PROJECT_TYPE=xml
else
PROJECT_TYPE=qrs
fi
cd $FIELDS_PATH
for f in *.$PROJECT_TYPE
do
if [[ "$PROJECT_TYPE" == "xml" ]];
then
$TRIK_DIR/patcher -f $f $DEFAULT_PROJECT
$TRIK_DIR/patcher -s $2 $DEFAULT_PROJECT
$TRIK_DIR/2D-model --mode script -c $DEFAULT_PROJECT
fi
if [[ "$PROJECT_TYPE" == "qrs" ]];
then
$TRIK_DIR/bin/patcher -s $2 $f
$TRIK_DIR/bin/2D-model --mode script -c $f
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment