Skip to content

Commit 23b0bf3

Browse files
authored
feat(create): Add new command for el-project (#325)
1 parent 716b071 commit 23b0bf3

File tree

6 files changed

+68
-2
lines changed

6 files changed

+68
-2
lines changed

cmds/create/el-project.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* Copyright (C) 2025 the Eask authors.
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 3, or (at your option)
7+
* any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
*/
17+
18+
"use strict";
19+
20+
exports.command = ['el-project'];
21+
exports.desc = 'Create a new project with `el-project`';
22+
23+
exports.handler = async (argv) => {
24+
await UTIL.e_call(argv, 'create/el-project');
25+
};

cmds/create/package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ exports.desc = 'Create a new package';
2424
exports.builder = yargs => yargs
2525
.positional(
2626
'<name>', {
27-
description: 'new project name',
27+
description: 'new package name',
2828
type: 'string',
2929
});
3030

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ eask [GLOBAL-OPTIONS] create elpa <name>
3737
💡 The template project is located in https://github.com/emacs-eask/template-elpa
3838
{{< /hint >}}
3939

40+
## 🔍 eask create el-project
41+
42+
Create a new project with [el-project](https://github.com/Kyure-A/el-project).
43+
44+
```sh
45+
eask [GLOBAL-OPTIONS] create el-project
46+
```
47+
4048
# 🚩 Core
4149

4250
Often use commands that are uncategorized.

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
@@ -37,6 +37,14 @@ eask [GLOBAL-OPTIONS] create elpa <name>
3737
💡 模板項目位於 https://github.com/emacs-eask/template-elpa。
3838
{{< /hint >}}
3939

40+
## 🔍 eask create el-project
41+
42+
使用 [el-project](https://github.com/Kyure-A/el-project) 創建一個新專案。
43+
44+
```sh
45+
eask [GLOBAL-OPTIONS] create el-project
46+
```
47+
4048
# 🚩 核心
4149

4250
經常使用未分類的命令。

lisp/_prepare.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ will return `lint/checkdoc' with a dash between two subcommands."
191191
These commands will first respect the current workspace. If the current
192192
workspace has no valid Eask-file; it will load global workspace instead."
193193
(eask-command-p '("init" "init/source" "init/cask" "init/eldev" "init/keg"
194-
"create/package" "create/elpa"
194+
"create/package" "create/elpa" "create/el-project"
195195
"bump" "cat" "keywords" "repl"
196196
"generate/ignore" "generate/license"
197197
"test/melpazoid")))

lisp/create/el-project.el

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
;;; create/el-project.el --- Create a new elisp project -*- lexical-binding: t; -*-
2+
3+
;;; Commentary:
4+
;;
5+
;; Create a new elisp project,
6+
;;
7+
;; $ eask create el-project
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+
;; Preparation
19+
(eask-archive-install-packages '("gnu" "melpa" "jcs-elpa")
20+
'el-project)
21+
;; Start project creation.
22+
(require 'el-project)
23+
(el-project-make-project))
24+
25+
;;; create/el-project.el ends here

0 commit comments

Comments
 (0)