forked from Bunteshaus/bunteshaus.de
small fixes
This commit is contained in:
parent
8054e74052
commit
b91d153354
|
@ -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 "
|
||||||
|
|
Loading…
Reference in New Issue