diff --git a/add_archive.sh b/add_archive.sh index 133c733..8e54a67 100755 --- a/add_archive.sh +++ b/add_archive.sh @@ -3,6 +3,7 @@ err() { echo "${1}" zenity --error --no-wrap --text "${1}" + exit 1 } warn() { @@ -13,11 +14,8 @@ warn() { if ! command -v unzip &> /dev/null then err "'unzip' could not be found" - exit 1 fi - - if [ ${#@} -eq 0 ]; then # no arguments IFS=$'\n' files=($(zenity --file-selection --multiple --separator=$'\n' --title="Choose files")) @@ -31,21 +29,17 @@ for file in "${files[@]}"; do folder="content/posts/${fname}" if ! unzip -l "${file}"|grep -q "index.de.md"; then err "maybe wrong archive, this is not compatible" - exit 1 fi if ! [ -d content ]; then err "folder 'content' not found" - exit 1 fi - set -x mkdir -p "${folder}" - unzip -d "${folder}" "${file}" + unzip -fd "${folder}" "${file}" || err "unzip failed" git add "${folder}" git commit -m "${fname}" done -output="Done." output_temp="" for file in "${files[@]}"; do @@ -63,3 +57,4 @@ for file in "${files[@]}"; do done warn "${output_temp}" +zenity --info --text "Done" diff --git a/content/posts/2022-06-26-blubbi-blub/index.de.md b/content/posts/2022-06-26-blubbi-blub/index.de.md deleted file mode 100644 index edbbc69..0000000 --- a/content/posts/2022-06-26-blubbi-blub/index.de.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: "Blubbi blub" -date: 2022-06-26T16:21:00+02:00 ---- -Blubbi blub blub \ No newline at end of file diff --git a/content/posts/2022-06-26-testartikel/index.de.md b/content/posts/2022-06-26-testartikel/index.de.md deleted file mode 100644 index 7335060..0000000 --- a/content/posts/2022-06-26-testartikel/index.de.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Testartikel" -date: 2022-06-26T19:03:00+02:00 -news: ["Buha"] -events: ["Konzert"] -tags: ["Buha","Konzert","Andrej Turkovskij"] ---- -Inhalt des Artikels -Ich weiss nicht was ich schreiben soll \ No newline at end of file diff --git a/content/posts/2022-06-26-testartikel/ujscvzou80j61.jpg b/content/posts/2022-06-26-testartikel/ujscvzou80j61.jpg deleted file mode 100644 index f67e490..0000000 Binary files a/content/posts/2022-06-26-testartikel/ujscvzou80j61.jpg and /dev/null differ diff --git a/push.sh b/push.sh index 8328ba6..67417da 100755 --- a/push.sh +++ b/push.sh @@ -1,17 +1,4 @@ #!/bin/bash -date="$(date +%Y-%m-%d)-test" git pull --rebase upstream main && \ git push origin && \ - -exit -git add content/posts -git commit --amend --no-edit -target="origin" -force="-f" -if [ "$1" = "upstream" ]; then - target=upstream - force="" -fi - -git push ${target} ${force}