Skip to content

Commit 050cea2

Browse files
authored
fix(init): Fix load path and basename on unix (#149)
* fix(init): Fix load path and basename on unix * ci(docs): Don't build doc in PR unless it changes
1 parent 90cedc5 commit 050cea2

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
branches:
1616
- master
1717
paths-ignore:
18-
- '**.md'
18+
- '**.md'
1919
workflow_dispatch:
2020

2121
concurrency:

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
pull_request:
1212
branches:
1313
- master
14+
paths:
15+
- '**.yml'
16+
- docs/**
1417
workflow_dispatch:
1518

1619
concurrency:

docs/content/en/Development API/_index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ your projects and extensions to Eask.
1515
Load `lisp/_prepare.el` to start using other Eask API.
1616

1717
```elisp
18-
(load (expand-file-name
19-
"../_prepare.el"
20-
(file-name-directory (nth 1 (member "-scriptload" command-line-args))))
21-
nil t)
18+
(let ((dir (file-name-directory (nth 1 (member "-scriptload" command-line-args)))))
19+
(load (expand-file-name "_prepare.el"
20+
(locate-dominating-file dir "_prepare.el"))
21+
nil t))
2222
```
2323

2424
Each Elisp scripts should have this snippet at the very top of the file.

lisp/init/cask.el

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99

1010
;;; Code:
1111

12-
(load (expand-file-name
13-
"../_prepare.el"
14-
(file-name-directory (nth 1 (member "-scriptload" command-line-args))))
15-
nil t)
12+
(let ((dir (file-name-directory (nth 1 (member "-scriptload" command-line-args)))))
13+
(load (expand-file-name "_prepare.el"
14+
(locate-dominating-file dir "_prepare.el"))
15+
nil t))
1616

1717
(defun eask--convert-cask (filename)
1818
"Convert Cask FILENAME to Eask."
1919
(let* ((filename (expand-file-name filename))
20-
(file (eask-root-del filename))
20+
(file (file-name-nondirectory (eask-root-del filename)))
2121
(new-file (eask-s-replace "Cask" "Eask" file))
2222
(new-filename (expand-file-name new-file))
2323
(converted))
@@ -33,7 +33,9 @@
3333
(insert-file-contents file)
3434
(goto-char (point-min))
3535
(while (re-search-forward "(source " nil t)
36-
(insert "'")) ; make it symbol
36+
(forward-word 1)
37+
(forward-word -1) ; make sure infront of the word
38+
(insert "'")) ; make it symbol
3739
(save-buffer))
3840
(setq converted t))))
3941
(if converted "done ✓" "skipped ✗"))

0 commit comments

Comments
 (0)