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
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 "

View File

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