Skip to content

Commit 2a3872b

Browse files
committed
feat: Add root command
1 parent a91a412 commit 2a3872b

5 files changed

Lines changed: 55 additions & 1 deletion

File tree

cmds/util/root.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* $File: root.js $
3+
* $Date: 2025-12-27 20:29:35 $
4+
* $Revision: $
5+
* $Creator: Jen-Chieh Shen $
6+
* $Notice: See LICENSE.txt for modification and distribution information
7+
* Copyright © 2025 by Shen, Jen-Chieh $
8+
*/
9+
10+
"use strict";
11+
12+
exports.command = ['root'];
13+
exports.desc = 'Display the effective installation directory of your Emacs packages';
14+
15+
exports.handler = async (argv) => {
16+
await UTIL.e_call(argv, 'util/root');
17+
};

docs/content/Getting-Started/Commands-and-options/_index.en.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,14 @@ Show the location where Eask is installed.
992992
eask [GLOBAL-OPTIONS] locate
993993
```
994994

995+
## 🔍 eask root
996+
997+
Display the effective installation directory of your Emacs packages.
998+
999+
```sh
1000+
eask [GLOBAL-OPTIONS] root
1001+
```
1002+
9951003
# 🚩 Checker
9961004

9971005
Commands to check your Eask-file.

docs/content/Getting-Started/Commands-and-options/_index.zh-tw.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,14 @@ eask [GLOBAL-OPTIONS] upgrade-eask
978978
eask [GLOBAL-OPTIONS] locate
979979
```
980980

981+
## 🔍 eask root
982+
983+
顯示包的安裝目錄。
984+
985+
```sh
986+
eask [GLOBAL-OPTIONS] root
987+
```
988+
981989
# 🚩 檢查器
982990

983991
檢查您的 Eask 文件的命令。

lisp/_prepare.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ workspace has no valid Eask-file; it will load global workspace instead."
197197
"create/package" "create/elpa" "create/el-project"
198198
"bump" "cat" "keywords" "repl"
199199
"generate/ignore" "generate/license"
200-
"test/melpazoid")))
200+
"test/melpazoid"
201+
"util/root")))
201202

202203
(defun eask-execution-p ()
203204
"Return t if the command is the execution command.

lisp/util/root.el

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
;;; util/root.el --- Display the effective installation directory -*- lexical-binding: t; -*-
2+
3+
;;; Commentary:
4+
;;
5+
;; Command use to display the effective installation directory,
6+
;;
7+
;; $ eask root
8+
;;
9+
10+
;;; Code:
11+
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))
16+
17+
(eask-start
18+
(eask-println "%s\n" user-emacs-directory))
19+
20+
;;; util/root.el ends here

0 commit comments

Comments
 (0)