small fixes

This commit is contained in:
teldra 2022-06-26 19:14:13 +02:00
parent 4a53524cb6
commit 0975873f3e
5 changed files with 3 additions and 35 deletions

View File

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

View File

@ -1,5 +0,0 @@
---
title: "Blubbi blub"
date: 2022-06-26T16:21:00+02:00
---
Blubbi blub blub

View File

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 667 KiB

13
push.sh
View File

@ -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}