small fixes

This commit is contained in:
teldra 2022-06-26 19:44:15 +02:00
parent 8054e74052
commit b91d153354
2 changed files with 13 additions and 4 deletions

View File

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

View File

@ -1,4 +1,7 @@
#!/bin/bash #!/bin/bash
# update from upstream/main
git pull --rebase upstream main && \ git pull --rebase upstream main && \
git push origin && \
# send own changes
git push origin