From 400903ea02d06bd78a2c4633a42dc9b912307a0d Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 27 Oct 2024 10:40:37 -0300 Subject: [PATCH] emacsPackages: use better SCRIPT_DIR detection in update scripts --- pkgs/applications/editors/emacs/elisp-packages/update | 8 +++++--- .../editors/emacs/elisp-packages/update-manual | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/update b/pkgs/applications/editors/emacs/elisp-packages/update index 02701fb546d95..e9f649c8aa50e 100755 --- a/pkgs/applications/editors/emacs/elisp-packages/update +++ b/pkgs/applications/editors/emacs/elisp-packages/update @@ -1,10 +1,12 @@ #!/usr/bin/env bash set -euo pipefail -SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )" -cd "$SCRIPT_DIR" +# Classic "where I am" block +# https://www.binaryphile.com/bash/2020/01/12/determining-the-location-of-your-script-in-bash.html +SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); cd -P $(dirname $(readlink ${BASH_SOURCE[0]} || echo .)); pwd) +cd "${SCRIPT_DIR}" ./update-from-overlay ./update-manual -git commit -m "emacs.pkgs.manualPackages: $(date --iso)" -- . +git commit -m "emacsPackages.manualPackages: updated at $(date --iso) (non-interactively)" -- . diff --git a/pkgs/applications/editors/emacs/elisp-packages/update-manual b/pkgs/applications/editors/emacs/elisp-packages/update-manual index 3b199eecc3d2b..1a83f14b7b74b 100755 --- a/pkgs/applications/editors/emacs/elisp-packages/update-manual +++ b/pkgs/applications/editors/emacs/elisp-packages/update-manual @@ -1,7 +1,9 @@ #!/usr/bin/env bash set -euo pipefail -SCRIPT_DIR="$( cd "$(dirname "$0")" ; pwd -P )" -cd "$SCRIPT_DIR" +# Classic "where I am" block +# https://www.binaryphile.com/bash/2020/01/12/determining-the-location-of-your-script-in-bash.html +SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); cd -P $(dirname $(readlink ${BASH_SOURCE[0]} || echo .)); pwd) +cd "${SCRIPT_DIR}" nix-build --no-out-link update-manual.nix | xargs -n 1 -P $(nproc) bash -c