Skip to content

Instantly share code, notes, and snippets.

@anastasiia-kornilova
Last active February 9, 2021 10:47
  • Star 0 You must be signed in to star a gist
  • Fork 0 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?
#!/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