diff --git a/devtools/README.md b/devtools/README.md index e415ba6..155f9aa 100644 --- a/devtools/README.md +++ b/devtools/README.md @@ -1,4 +1,4 @@ # Development tools ## Files: -* __fake_java.py__ can be used to get the command used to start Minecraft. When run, it will create a file called `fake_java_out.txt` in its working directory. +* __harvest_arguments.sh__ can be used to get the command used to start Minecraft. Just rename the Java executable to _backup and put this file in its place. Output files will be created in the running directory. They are named by the current date. * __rmpyc__ removes all `.pyc` files in the current working directory and all subdirectories. diff --git a/devtools/fake_java.py b/devtools/fake_java.py deleted file mode 100755 index e3b1732..0000000 --- a/devtools/fake_java.py +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/python2 - -import sys - -first_argument=True -out=open("fake_java_out.txt", "w") -for element in range(len(sys.argv)): - out.write(sys.argv[element]) - first_argument=False - if not first_argument: - out.write(" ") -out.close() diff --git a/devtools/harvest_arguments.sh b/devtools/harvest_arguments.sh new file mode 100755 index 0000000..7138ded --- /dev/null +++ b/devtools/harvest_arguments.sh @@ -0,0 +1,10 @@ +#!/bin/bash +NOW=`date` +echo "Executable: $0" > "$NOW.log" +echo "Timestamp: $NOW" >> "$NOW.log" +echo -n "Arguments: " >> "$NOW.log" +echo "$*" | sed ':a;s/ -/\n >>>-/;ta' >> "$NOW.log" +echo "Full command: $0 $*" >> "$NOW.log" +BACKUPCMD="`readlink -f \`which $0\``_backup" +echo "Actual command: $BACKUPCMD $*" >> "$NOW.log" +echo "$BACKUPCMD $*" | sh