Skip to content

Commit

Permalink
emacsPackages: use better SCRIPT_DIR detection in update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersonTorres committed Nov 1, 2024
1 parent c7c5aae commit 599ee53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions pkgs/applications/editors/emacs/elisp-packages/update
Original file line number Diff line number Diff line change
@@ -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)" -- .
6 changes: 4 additions & 2 deletions pkgs/applications/editors/emacs/elisp-packages/update-manual
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 599ee53

Please sign in to comment.