From 62411756bf587ba968703be8b60e87a7288a6bfc Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Mon, 23 May 2022 17:46:08 +0000 Subject: [PATCH] Include new language paramter SigScript version Co-authored-by: sigonasr2 --- {scripts => Java/scripts}/build.sh | 2 +- Java/scripts/clean.sh | 4 ++++ {scripts => Java/scripts}/commit.sh | 0 {scripts => Java/scripts}/jar.sh | 2 +- Java/scripts/md5 | 4 ++++ scripts/clean.sh | 3 --- scripts/lean.sh | 1 - scripts/md5 | 5 ----- sig | 1 + tmp | 11 +++++++++++ utils/define.sh | 2 ++ utils/main.sh | 6 +++--- utils/md5 | 6 +++--- utils/search.sh | 28 +++++++--------------------- 14 files changed, 37 insertions(+), 38 deletions(-) rename {scripts => Java/scripts}/build.sh (83%) create mode 100755 Java/scripts/clean.sh rename {scripts => Java/scripts}/commit.sh (100%) rename {scripts => Java/scripts}/jar.sh (94%) create mode 100644 Java/scripts/md5 delete mode 100644 scripts/clean.sh delete mode 100644 scripts/lean.sh delete mode 100644 scripts/md5 create mode 100644 tmp diff --git a/scripts/build.sh b/Java/scripts/build.sh similarity index 83% rename from scripts/build.sh rename to Java/scripts/build.sh index bdcd96d..a9eba68 100755 --- a/scripts/build.sh +++ b/Java/scripts/build.sh @@ -6,4 +6,4 @@ printf "\n\n\nRunning Program...\n\n" ORIGINAL_LOC=$(pwd) cd $OUT_DIR java ${MAIN_CLASS} "$@" -${ORIGINAL_LOC}/scripts/clean.sh \ No newline at end of file +${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh \ No newline at end of file diff --git a/Java/scripts/clean.sh b/Java/scripts/clean.sh new file mode 100755 index 0000000..55f2398 --- /dev/null +++ b/Java/scripts/clean.sh @@ -0,0 +1,4 @@ +#Cleans up and removes unused files. +#Java +find . -type f -name *.class -delete +find . -type f -name manifest -delete \ No newline at end of file diff --git a/scripts/commit.sh b/Java/scripts/commit.sh similarity index 100% rename from scripts/commit.sh rename to Java/scripts/commit.sh diff --git a/scripts/jar.sh b/Java/scripts/jar.sh similarity index 94% rename from scripts/jar.sh rename to Java/scripts/jar.sh index ed70855..9447876 100755 --- a/scripts/jar.sh +++ b/Java/scripts/jar.sh @@ -13,4 +13,4 @@ printf "\n\n\nRunning Program...\n\n" java -jar ${PROJECT_NAME}.jar "$@" mv ${PROJECT_NAME}.jar ${ORIGINAL_LOC} cd .. -./scripts/clean.sh +./${LANGUAGE}/scripts/clean.sh diff --git a/Java/scripts/md5 b/Java/scripts/md5 new file mode 100644 index 0000000..7975167 --- /dev/null +++ b/Java/scripts/md5 @@ -0,0 +1,4 @@ +build.sh:377a432ffbd63b53322d1451a214201d - +clean.sh:96ce35f2d2dcb555421e00a6afda23ca - +commit.sh:b186d649fa17c68926fe1caec4a7216c - +jar.sh:02707b9398a76825f81ba7a71f5f4a34 - diff --git a/scripts/clean.sh b/scripts/clean.sh deleted file mode 100644 index 4df830c..0000000 --- a/scripts/clean.sh +++ /dev/null @@ -1,3 +0,0 @@ -# -#Java -404: Not Found \ No newline at end of file diff --git a/scripts/lean.sh b/scripts/lean.sh deleted file mode 100644 index 1becba2..0000000 --- a/scripts/lean.sh +++ /dev/null @@ -1 +0,0 @@ -404: Not Found \ No newline at end of file diff --git a/scripts/md5 b/scripts/md5 deleted file mode 100644 index 2286320..0000000 --- a/scripts/md5 +++ /dev/null @@ -1,5 +0,0 @@ -build.sh:a833e7598ad65672a9c01306d244b49f - -clean.sh:0624843aaeb338a8bda3c2c6edf43b4e - -commit.sh:b186d649fa17c68926fe1caec4a7216c - -jar.sh:62ce62bbb97d3f3856bcc9b0ad34083c - -lean.sh:3be7b8b182ccd96e48989b4e57311193 - diff --git a/sig b/sig index 5f8d83f..a659f7b 100755 --- a/sig +++ b/sig @@ -4,5 +4,6 @@ define PROJECT_NAME "JavaProjectTemplate" define PROJECT_DIR "src/sig" define MAIN_CLASS "sig.${PROJECT_NAME}" define OUT_DIR "bin" +define LANGUAGE "Java" source utils/main.sh \ No newline at end of file diff --git a/tmp b/tmp new file mode 100644 index 0000000..b81d66d --- /dev/null +++ b/tmp @@ -0,0 +1,11 @@ +.coauthors:3785ad38663e5fc43e574914ad067294 - +define.sh:d6b20a25a04a60d94f466e48fa60ac69 - +main.sh:32a1f953ffca8584d1eb57c0ecd8a582 - +search.sh:3321258db3b59d8e4cfe04c472516e45 - +.updateDirectories:0ede00461e947494545e694040787b3f - +commit.sh:9c342703d765cad7ea296f16d68f29f4 - +.coauthors:3785ad38663e5fc43e574914ad067294 - +define.sh:d6b20a25a04a60d94f466e48fa60ac69 - +main.sh:32a1f953ffca8584d1eb57c0ecd8a582 - +search.sh:3321258db3b59d8e4cfe04c472516e45 - +.updateDirectories:0ede00461e947494545e694040787b3f - diff --git a/utils/define.sh b/utils/define.sh index 0926c6c..39a23d7 100755 --- a/utils/define.sh +++ b/utils/define.sh @@ -1,5 +1,7 @@ export VARS=("") +export LANGUAGE="" + function define() { VARS+=("$1") value="${*:2}" diff --git a/utils/main.sh b/utils/main.sh index 645950d..b04ffab 100644 --- a/utils/main.sh +++ b/utils/main.sh @@ -13,11 +13,11 @@ if [ -z "$1" ] echo "" echo "" echo " Command List:" - FILES=$(ls -1A ./scripts | sed -e 's/\.sh$//' | sed -e 's/^/ /') + FILES=$(ls -1A ./$LANGUAGE/scripts | sed -e 's/\.sh$//' | sed -e 's/^/ /') for f in $FILES do if [ $f != "md5" ]; then - DESC="$(head -n1 ./scripts/$f.sh)" + DESC="$(head -n1 ./$LANGUAGE/scripts/$f.sh)" printf "\n\t%-15s%-65s" $f "${DESC:1}" fi done @@ -25,4 +25,4 @@ if [ -z "$1" ] exit fi -./scripts/$1.sh "${*:2}" \ No newline at end of file +./$LANGUAGE/scripts/$1.sh "${*:2}" \ No newline at end of file diff --git a/utils/md5 b/utils/md5 index f6c08d8..32d88fe 100644 --- a/utils/md5 +++ b/utils/md5 @@ -1,5 +1,5 @@ .coauthors:3785ad38663e5fc43e574914ad067294 - -define.sh:d6b20a25a04a60d94f466e48fa60ac69 - -main.sh:32a1f953ffca8584d1eb57c0ecd8a582 - -search.sh:3321258db3b59d8e4cfe04c472516e45 - +define.sh:74ea08fb12cab1053663f87007ddd29a - +main.sh:eacf0984141d284db6681dee4dc39ffa - +search.sh:7162a8e3487a5cca5a3a24d55230e24d - .updateDirectories:0ede00461e947494545e694040787b3f - diff --git a/utils/search.sh b/utils/search.sh index a25b87a..13307c4 100644 --- a/utils/search.sh +++ b/utils/search.sh @@ -39,27 +39,13 @@ function check() { if [ -f $1$g ]; then if [ "$g" != ".coauthors" ]; then - echo "++Redownload $1$g..." - if [ -f "$1$g" ]; then - #Read the 2nd line and see if it has a special directory. - CHECKLINE=$(sed -n '2{p;q;}' $1$g) - if [ "${CHECKLINE:0:1}" = "#" ]; then - #This could be a different diff, try that one. - echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1md5" - curl -H 'Cache-Control: no-cache, no-store' -s https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1md5 --output /tmp/out - cmp -s $1/md5 /tmp/out - if [ "$?" -ne 0 ] - then - echo " Differences detected here too." - curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1$g --output $1$g - fi - else - curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g - fi - else - echo "===Could not find directory, assuming regular scripts directory exists." - curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output scripts/$g - fi + echo "++Redownload $1$g..." + if [ -f "$1$g" ]; then + curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g + else + echo "===Could not find directory, assuming regular scripts directory exists." + curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $LANGUAGE/scripts/$g + fi fi else echo "++==Downloading $1$g..."