|
|
#!/bin/bash |
|
|
|
|
|
if [ -z "$1" ]; then |
|
|
echo "Usage: $0 <path1>" |
|
|
exit 1 |
|
|
fi |
|
|
if [ -z "$2" ]; then |
|
|
echo "Usage: $0 $1 <path2>" |
|
|
exit 1 |
|
|
fi |
|
|
|
|
|
echo "STARTING TOOL" |
|
|
|
|
|
|
|
|
filename=$(basename "$1") |
|
|
nameWithoutType=$(echo "$filename" | awk -F '.' '{print $1}') |
|
|
|
|
|
|
|
|
SRC_DIR=$(dirname "$1") |
|
|
|
|
|
txtFile="$nameWithoutType.txt" |
|
|
txtFilePath="$SRC_DIR/$txtFile" |
|
|
|
|
|
|
|
|
TOOL_DIR="$2" |
|
|
SCRIPT_DIR="$TOOL_DIR/script_py" |
|
|
PATCHITPY_SCRIPT_PATH="$TOOL_DIR/patchitpy_ext.sh" |
|
|
|
|
|
echo "PATCHITPY_SCRIPT_PATH: $TOOL_DIR" |
|
|
|
|
|
|
|
|
python3 "$SCRIPT_DIR/convertInline.py" "$1" "$txtFilePath" |
|
|
bash "$PATCHITPY_SCRIPT_PATH" "$txtFilePath" "$TOOL_DIR" |
|
|
|
|
|
|
|
|
echo "Cleaning up..." |
|
|
rm -f "$txtFilePath" |
|
|
rm -f "$TOOL_DIR/generated_file"/*.txt |
|
|
|
|
|
|