small fixes
This commit is contained in:
parent
4a53524cb6
commit
0975873f3e
|
@ -3,6 +3,7 @@
|
||||||
err() {
|
err() {
|
||||||
echo "${1}"
|
echo "${1}"
|
||||||
zenity --error --no-wrap --text "${1}"
|
zenity --error --no-wrap --text "${1}"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
warn() {
|
warn() {
|
||||||
|
@ -13,11 +14,8 @@ warn() {
|
||||||
if ! command -v unzip &> /dev/null
|
if ! command -v unzip &> /dev/null
|
||||||
then
|
then
|
||||||
err "'unzip' could not be found"
|
err "'unzip' could not be found"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ ${#@} -eq 0 ]; then
|
if [ ${#@} -eq 0 ]; then
|
||||||
# no arguments
|
# no arguments
|
||||||
IFS=$'\n' files=($(zenity --file-selection --multiple --separator=$'\n' --title="Choose files"))
|
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}"
|
folder="content/posts/${fname}"
|
||||||
if ! unzip -l "${file}"|grep -q "index.de.md"; then
|
if ! unzip -l "${file}"|grep -q "index.de.md"; then
|
||||||
err "maybe wrong archive, this is not compatible"
|
err "maybe wrong archive, this is not compatible"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
if ! [ -d content ]; then
|
if ! [ -d content ]; then
|
||||||
err "folder 'content' not found"
|
err "folder 'content' not found"
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
set -x
|
|
||||||
mkdir -p "${folder}"
|
mkdir -p "${folder}"
|
||||||
unzip -d "${folder}" "${file}"
|
unzip -fd "${folder}" "${file}" || err "unzip failed"
|
||||||
git add "${folder}"
|
git add "${folder}"
|
||||||
git commit -m "${fname}"
|
git commit -m "${fname}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
output="Done."
|
|
||||||
output_temp=""
|
output_temp=""
|
||||||
|
|
||||||
for file in "${files[@]}"; do
|
for file in "${files[@]}"; do
|
||||||
|
@ -63,3 +57,4 @@ for file in "${files[@]}"; do
|
||||||
done
|
done
|
||||||
|
|
||||||
warn "${output_temp}"
|
warn "${output_temp}"
|
||||||
|
zenity --info --text "Done"
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
---
|
|
||||||
title: "Blubbi blub"
|
|
||||||
date: 2022-06-26T16:21:00+02:00
|
|
||||||
---
|
|
||||||
Blubbi blub blub
|
|
|
@ -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
13
push.sh
|
@ -1,17 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
date="$(date +%Y-%m-%d)-test"
|
|
||||||
|
|
||||||
git pull --rebase upstream main && \
|
git pull --rebase upstream main && \
|
||||||
git push origin && \
|
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}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user