diff --git a/add_archive.sh b/add_archive.sh index 137a5e2..8aea161 100755 --- a/add_archive.sh +++ b/add_archive.sh @@ -27,6 +27,7 @@ IFS=$'\n' files=($(zenity --file-selection --multiple --separator=$'\n' --title= # check and extract files to destination path for file in "${files[@]}"; do + # sanitize filename s="$(basename ${file%.*})" # receive input in first argument s="${s//[^[:alnum:]]/-}" # replace all non-alnum characters to - @@ -45,20 +46,23 @@ for file in "${files[@]}"; do if ! [ -d "${PATH}" ]; then err "Folder 'content' not found." fi + # create folder mkdir -p "${folder}" + # deflate zip file unzip -o -d "${folder}" "${file}" + # add folder for next commit - git add "${folder}" - # commit that folder - git commit -m "${fname}" + git add "${folder}" && \ + git commit -m "${fname}" # commit that folder done # make a couple of lints for the archives output_temp="" for file in "${files[@]}"; do banner="false" + # sanitize filename s="$(basename ${file%.*})" # receive input in first argument s="${s//[^[:alnum:]]/-}" # replace all non-alnum characters to - @@ -67,6 +71,7 @@ for file in "${files[@]}"; do s="${s/%-}" # remove - from end fname="${s,,}" # convert to lowercase folder="${PATH}/${fname}" + # get a list of files in folder for f in $(find "${folder}" -type f); do # check if a file called 'banner*' exists @@ -74,6 +79,7 @@ for file in "${files[@]}"; do banner="true" fi done + # compile missing or worng things if [ ${banner} == "false" ]; then output_temp="${output_temp}banner missing\n " diff --git a/push.sh b/push.sh index 67417da..7a63f6b 100755 --- a/push.sh +++ b/push.sh @@ -1,4 +1,7 @@ #!/bin/bash +# update from upstream/main git pull --rebase upstream main && \ -git push origin && \ + +# send own changes +git push origin