summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-08-15 14:30:37 -0500
committerCraig Jennings <c@cjennings.net>2025-08-15 14:30:37 -0500
commit76c1c434ad7cd7392c9df25b74e0d7976fa5deef (patch)
treedb77f88505518307ab7189e2951d4e704ac8ebe9 /scripts
parente2921d32fd22355ab2614aecc801a8f412b4b6eb (diff)
downloaddotemacs-76c1c434ad7cd7392c9df25b74e0d7976fa5deef.tar.gz
dotemacs-76c1c434ad7cd7392c9df25b74e0d7976fa5deef.zip
chore(build): enable strict bash mode and bump Emacs version
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build-emacs-from-source.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/build-emacs-from-source.sh b/scripts/build-emacs-from-source.sh
index a2272838..e28d19a5 100755
--- a/scripts/build-emacs-from-source.sh
+++ b/scripts/build-emacs-from-source.sh
@@ -16,18 +16,33 @@
# ...and I'm avoiding native compilation at the moment
#./configure --with-native-compilation \
-set -e
+# debugging assistance
+set -euo pipefail
+# -e: exit on any (non-zero) return‐code
+# -u: treat unset variables as errors
+# -o pipefail: if any stage of a pipeline fails, the whole pipeline fails
+
+# optional: show each command as you go, prefixed with file:line
+# export PS4='+ ${BASH_SOURCE[0]}:${LINENO}: '
+# set -x
+
+# trap all errors and identify line
+trap 'echo "❌ ERROR at ${BASH_SOURCE[0]}:${LINENO}: $BASH_COMMAND" >&2' ERR
# Review These Variables
src_dir="$HOME/code/emacs"
emacs_repo="https://github.com/mirrors/emacs.git"
-emacs_tag="emacs-29.1"
+emacs_tag="emacs-30.2"
logfile="$HOME/emacs_build.log"
# Function to remove + recreate directory, and clone source
nuke_and_clone () {
cd "$HOME"
+ if [ -f "$logfile" ]l then
+ rm "$logfile"
+ fi
+
if [ -d "$src_dir" ]; then
printf "...removing directory %s\n\n" "$src_dir"
rm -rf "$src_dir" >> "$logfile" 2>&1
@@ -71,7 +86,7 @@ else
nuke_and_clone
fi
-if [ ! $1 == "latest" ]; then
+if [ ! "${$1:-}" == "latest" ]; then
printf "...checking out tag: %s\n" "$emacs_tag" | tee -a "$logfile"
git checkout "$emacs_tag" >> "$logfile" 3>&1
else