Make publish script workable from any directory

This commit is contained in:
Marcel Kapfer 2022-02-15 19:58:26 +01:00
parent 5984dbcdd9
commit 3dbc64f11a
Signed by: mmk2410
GPG Key ID: CADE6F0C09F21B09
1 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,15 @@
#!/bin/sh
emacs -Q --script ./publish.el
set -euo pipefail
PUBLISH_SCRIPT_PATH=./publish/publish.el
EMACS_CONF_DIR=~/.emacs.d
CURRENT_DIR=$(pwd)
function goBack() {
cd "$CURRENT_DIR"
}
trap goBack EXIT
cd "$EMACS_CONF_DIR" || exit
emacs -Q --script ./publish/publish.el