Update SigScript

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent 9fcd0384ab
commit ff1761f5c8
  1. 6
      Java/scripts/build.sh
  2. 4
      Java/scripts/clean.sh
  3. 1
      Java/scripts/commit.sh
  4. 8
      Java/scripts/jar.sh
  5. 14
      Java/scripts/release.sh
  6. 3
      Java/scripts/update.sh
  7. 3
      utils/define.sh
  8. 4
      utils/main.sh
  9. 61
      utils/search.sh

@ -1,9 +1,9 @@
#Builds and runs the project.
#Java
rm -Rf out/*
javac -Xlint:unchecked -cp ${PROJECT_DIR}/.. -d ${OUT_DIR} ${PROJECT_DIR}/*.java
source ${LANGUAGE}/scripts/version_info
javac -source ${SOURCE_VERSION} -target ${TARGET_VERSION} -Xlint:unchecked -cp ${CLASS_PATH} -d ${OUT_DIR} ${PROJECT_DIR}/*.java
printf "\n\n\nRunning Program...\n\n"
ORIGINAL_LOC=$(pwd)
cd $OUT_DIR
java ${MAIN_CLASS} "$@"
java -cp .:../lib/bin -Djava.library.path="${LIBRARY_PATH}" ${MAIN_CLASS} "$@"
${ORIGINAL_LOC}/${LANGUAGE}/scripts/clean.sh

@ -1,4 +1,4 @@
#Cleans up and removes unused files.
#Java
find . -type f -name *.class -delete
find . -type f -name manifest -delete
find -type f -name *.class -delete
find -type f -name manifest -delete

@ -1,6 +1,7 @@
#Adds a commit message and pushes project to github repository.
#Java
COMMIT_MESSAGE="$*"
FIRST_LINE=true
while IFS= read -r line
do
if [ "$FIRST_LINE" = true ]; then

@ -1,7 +1,8 @@
#Builds a runnable jar file using ${MAIN_CLASS} as an entry point and then runs the newly generated jar.
#Java
source ${LANGUAGE}/scripts/version_info
rm -Rf bin/*
javac -Xlint:unchecked -cp src -d bin ${PROJECT_DIR}/${PROJECT_NAME}.java
javac -source ${SOURCE_VERSION} -target ${TARGET_VERSION} -Xlint:unchecked -cp ${CLASS_PATH} -d ${OUT_DIR} ${PROJECT_DIR}/${PROJECT_NAME}.java
printf "\n\n\nGenerating Manifest...\n\n"
touch manifest
echo "Main-Class: ${MAIN_CLASS}" >> manifest
@ -9,7 +10,8 @@ printf "\n\n\nCreating Jar...\n\n"
ORIGINAL_LOC=$(pwd)
cd ${OUT_DIR}
jar cfm ${PROJECT_NAME}.jar ${ORIGINAL_LOC}/manifest sig
jar uf ${PROJECT_NAME}.jar -C ../lib/bin/ .
printf "\n\n\nRunning Program...\n\n"
java -jar ${PROJECT_NAME}.jar "$@"
java -cp .:../lib/bin -Djava.library.path="${LIBRARY_PATH}" -jar ${PROJECT_NAME}.jar "$@"
../${LANGUAGE}/scripts/clean.sh
cd ..
./${LANGUAGE}/scripts/clean.sh

@ -0,0 +1,14 @@
#Creates a zip file containing all project contents.
#Java
source ${LANGUAGE}/scripts/version_info
TARGET_FILE="${PROJECT_NAME}_${RELEASE_VERSION}.zip"
FILES=$(cat ${LANGUAGE}/scripts/.package.files)
echo "Creating Package $TARGET_FILE..."
for f in $FILES
do
zip -ur $TARGET_FILE $f
done
echo "Complete!"
echo ""
echo ""
echo ""

@ -0,0 +1,3 @@
#Pulls the latest version of the repository.
#Java
git pull

@ -8,10 +8,11 @@ function define() {
eval export "$1"='$value'
}
if [[ $(pwd) != *"SigScript" ]]; then
if [[ $(pwd) != *"SigScript" && $AUTO_UPDATE = "true" ]]; then
source utils/search.sh
find . -type f -name md5 -delete
find . -type f -name filelist -delete
#Check for hashes
FILES=$(cat utils/.updateDirectories)

@ -13,10 +13,10 @@ if [ -z "$1" ]
echo ""
echo ""
echo " Command List:"
FILES=$(ls -1A ./$LANGUAGE/scripts | sed -e 's/\.sh$//' | sed -e 's/^/ /')
FILES=$(ls -1A ./$LANGUAGE/scripts 2>/dev/null | sed -e 's/\.sh$//' | sed -e 's/^/ /')
for f in $FILES
do
if [ $f != "md5" ]; then
if [ -f "./$LANGUAGE/scripts/$f.sh" ]; then
DESC="$(head -n1 ./$LANGUAGE/scripts/$f.sh)"
printf "\n\t%-15s%-65s" $f "${DESC:1}"
fi

@ -1,5 +1,5 @@
function search() {
FILES2=$(ls -A $1)
FILES2=$(ls -A $1 2>/dev/null)
for g in $FILES2
do
if [ -d $1$g ];
@ -8,11 +8,14 @@ function search() {
search $1$g/
else
echo "$1$g is a file"
if [ $g != "md5" ]; then
SUM=$(md5sum < $1$g)
echo "$g:$SUM" >> $1md5
if [ $g != "md5" ] && [ $g != "filelist" ] && [ $g != ".package.files" ]; then
if [ $g != ".coauthors" ] && [ $g != "version_info" ]; then
SUM=$(md5sum < $1$g)
echo "$g:$SUM" >> $1md5
fi
echo "$g" >> $1filelist
else
echo " md5 file, ignoring..."
echo " ignoring $g..."
fi
fi
done
@ -20,11 +23,11 @@ function search() {
function check() {
echo "Check $1"
FILES2=$(ls -A $1)
FILES2=$(ls -A $1 2>/dev/null)
if [ -f "$1/md5" ];
then
echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5"
curl -H 'Cache-Control: no-cache, no-store' -s https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5 --output /tmp/out
curl -H 'Cache-Control: no-cache, no-store' -s "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5" --output /tmp/out
cmp -s $1/md5 /tmp/out
if [ "$?" -ne 0 ]
then
@ -35,21 +38,55 @@ function check() {
IFS=':' read -ra split <<< $line
g="${split[0]}"
echo "LINE -- $g"
if [ "$g" != "md5" ]; then
if [ "$g" != "md5" ] && [ "$g" != "filelist" ] && [ "$g" != ".package.files" ]; then
if [ -f $1$g ];
then
if [ "$g" != ".coauthors" ] && [ "$g" != "version_info" ]; then
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..."
curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $1$g
fi
fi
done < /tmp/out
fi
fi
if [ -f "$1/filelist" ];
then
echo " filelist: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1filelist"
curl -H 'Cache-Control: no-cache, no-store' -s "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1filelist" --output /tmp/out
cmp -s $1/filelist /tmp/out
if [ "$?" -ne 0 ]
then
echo " Differences detected!"
cat /tmp/out
while IFS= read -r line
do
IFS=':' read -ra split <<< $line
g="${split[0]}"
echo "LINE -- $g"
if [ "$g" != "md5" ] && [ "$g" != "filelist" ] && [ "$g" != ".package.files" ]; then
if [ -f $1$g ];
then
if [ "$g" != ".coauthors" ]; then
if [ "$g" != ".coauthors" ] && [ "$g" != "version_info" ]; then
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
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
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..."
curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g
curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $1$g
fi
fi
done < /tmp/out

Loading…
Cancel
Save