Skip to content

Commit 8c5562d

Browse files
authored
feat(install): Add commands install-file and install-vc (#317)
* feat(install): Add commands install-file and install-vc * fix: Revert some mistake changes * docs: add doc * changelog * test: Try set higher timeout * fix: split spec * ci: Try one recipe instead * test: Inhibit vc install * chore: increase timeout even further * ci: further increase timeout * ci: Still avoid timeout on local archive * ci: try using a real timer * ci: Just increase it since no idea why it fails * ci: test skip for now * avoid vc install for now * feat: Handle force flag on package installation * changelog
1 parent 5261932 commit 8c5562d

File tree

27 files changed

+559
-89
lines changed

27 files changed

+559
-89
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
2020
* ci(build.yml): Try forked pkg to fix `arm64` build 2 (#292 and #294)
2121
* feat: Set error status when help is printed (#307)
2222
* feat: Add exit code specification (c49f53caa1f6ac94a9c8c884d70d0860f55728c1)
23+
* feat(install): Add commands `install-file` and `install-vc` (#317)
24+
* feat(install): Handle `--force` flag to overwrite installed packages (#317)
2325

2426
## 0.10.x
2527
> Released Jun 13, 2024

cmds/core/install-file.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 = ['install-file [files..]'];
21+
exports.desc = 'Install packages from files, .tar files, or directories';
22+
exports.builder = yargs => yargs
23+
.positional(
24+
'[files..]', {
25+
description: 'files to install as packages',
26+
type: 'array',
27+
});
28+
29+
exports.handler = async (argv) => {
30+
await UTIL.e_call(argv, 'core/install-file', argv.files);
31+
};

cmds/core/install-vc.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 = ['install-vc [specs..]'];
21+
exports.desc = 'Install packages directly from the version control';
22+
exports.builder = yargs => yargs
23+
.positional(
24+
'[specs..]', {
25+
description: 'vc specification to install as packages',
26+
type: 'array',
27+
});
28+
29+
exports.handler = async (argv) => {
30+
await UTIL.e_call(argv, 'core/install-vc', argv.specs);
31+
};

docs/content/DSL/_index.en.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Declare package's author.
5656

5757
## 🔍 **package-file** (`file` `version` `description`)
5858

59-
Define this package and its runtime dependencies from the package headers
59+
Define this package and its runtime dependencies from the package headers
6060
of a file (used only for package development).
6161

6262
```elisp
@@ -65,7 +65,7 @@ of a file (used only for package development).
6565

6666
## 🔍 **package-descriptor** (`pkg-file`)
6767

68-
Declare all package metadata directly by specifying a package descriptor
68+
Declare all package metadata directly by specifying a package descriptor
6969
contained in file with name given by file.
7070

7171
```elisp
@@ -149,14 +149,30 @@ Specify dependencies that are listed in **archives**:
149149
(depends-on "company")
150150
```
151151

152+
Specify dependencies in **file** format:
153+
154+
```elisp
155+
(depends-on "auto-rename-tag" :file "/path/to/auto-rename-tag")
156+
157+
(depends-on "lsp-ui" :file "/path/to/lsp-ui")
158+
```
159+
160+
Specify dependencies in **vc** format:
161+
162+
```elisp
163+
(depends-on "auto-rename-tag" :vc "jcs-elpa/auto-rename-tag")
164+
165+
(depends-on "lsp-ui" :vc "emacs-lsp/lsp-ui")
166+
```
167+
152168
Specify dependencies in **recipe** format:
153169

154170
```elisp
155-
(depends-on "auto-rename-tag"
156-
:repo "jcs-elpa/auto-rename-tag"
171+
(depends-on "auto-rename-tag"
172+
:repo "jcs-elpa/auto-rename-tag"
157173
:fetcher 'github)
158174
159-
(depends-on "lsp-ui"
175+
(depends-on "lsp-ui"
160176
:repo "emacs-lsp/lsp-ui"
161177
:fetcher 'github
162178
:files '(:defaults "lsp-ui-doc.html" "resources"))

docs/content/DSL/_index.zh-tw.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,30 @@ weight: 200
145145
(depends-on "company")
146146
```
147147

148+
**file** 格式指定依賴項:
149+
150+
```elisp
151+
(depends-on "auto-rename-tag" :file "/path/to/auto-rename-tag")
152+
153+
(depends-on "lsp-ui" :file "/path/to/lsp-ui")
154+
```
155+
156+
**vc** 格式指定依賴項:
157+
158+
```elisp
159+
(depends-on "auto-rename-tag" :vc "jcs-elpa/auto-rename-tag")
160+
161+
(depends-on "lsp-ui" :vc "emacs-lsp/lsp-ui")
162+
```
163+
148164
**recipe** 格式指定依賴項:
149165

150166
```elisp
151-
(depends-on "auto-rename-tag"
152-
:repo "jcs-elpa/auto-rename-tag"
167+
(depends-on "auto-rename-tag"
168+
:repo "jcs-elpa/auto-rename-tag"
153169
:fetcher 'github)
154170
155-
(depends-on "lsp-ui"
171+
(depends-on "lsp-ui"
156172
:repo "emacs-lsp/lsp-ui"
157173
:fetcher 'github
158174
:files '(:defaults "lsp-ui-doc.html" "resources"))

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ then,
129129
(message "%s" (eask-command)) ; init
130130
```
131131

132+
## 🔍 Function: eask-command-check (`version`)
133+
134+
Report error if the current command requires minimum `version`.
135+
136+
```elisp
137+
(eask-start
138+
(eask-command-check "27.1") ; The command requires 27.1 and above!
139+
...
140+
```
141+
132142
## 🔍 Function: eask-command-p (`commands`)
133143

134144
Return t if COMMANDS is the current command.

docs/content/Development-API/_index.zh-tw.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,16 @@ eask init
128128
(message "%s" (eask-command)) ; init
129129
```
130130

131+
## 🔍 函式: eask-command-check (`version`)
132+
133+
如果目前的指令需要最低的 `version` 就會報錯。
134+
135+
```elisp
136+
(eask-start
137+
(eask-command-check "27.1") ; 此指令需要 27.1 及以上版本!
138+
...
139+
```
140+
131141
## 🔍 函式: eask-command-p (`commands`)
132142

133143
如果 COMMANDS 是目前命令,則傳回 `t`

docs/content/Getting-Started/Basic-Usage/_index.en.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Commands:
4949
info Display information about the current package
5050
init [files..] Initialize project to use Eask
5151
install-deps Automatically install package dependencies [aliases: install-dependencies, prepare]
52+
install-file [files..] Install packages from files, .tar files, or directories
53+
install-vc [specs..] Install packages directly from the version control
5254
install [names..] Install packages
5355
keywords List available keywords that can be used in the header section
5456
link <action> Manage links

docs/content/Getting-Started/Basic-Usage/_index.zh-tw.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ Commands:
4646
info Display information about the current package
4747
init [files..] Initialize project to use Eask
4848
install-deps Automatically install package dependencies [aliases: install-dependencies, prepare]
49+
install-file [files..] Install packages from files, .tar files, or directories
50+
install-vc [specs..] Install packages directly from the version control
4951
install [names..] Install packages
5052
keywords List available keywords that can be used in the header section
5153
link <action> Manage links

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ Display the state of the workspace.
114114
eask [GLOBAL-OPTIONS] status
115115
```
116116

117+
## 🔍 eask install
118+
119+
To install packages.
120+
121+
```sh
122+
eask [GLOBAL-OPTIONS] install [PACKAGES..]
123+
```
124+
125+
Install packages by specifying arguments:
126+
127+
```sh
128+
eask install auto-complete helm magit
129+
```
130+
131+
Or else, it will install the package from the current development:
132+
133+
```sh
134+
eask install
135+
```
136+
117137
## 🔍 eask install-deps
118138

119139
To install all dependencies.
@@ -128,24 +148,20 @@ eask [GLOBAL-OPTIONS] install-deps [--dev]
128148
💡 Specify option [--dev] to install dependencies from the development scope.
129149
{{< /hint >}}
130150

131-
## 🔍 eask install
151+
## 🔍 eask install-file
132152

133-
To install packages.
153+
Install packages from files, `.tar` files, or directories.
134154

135155
```sh
136-
eask [GLOBAL-OPTIONS] install [PACKAGES..]
156+
eask [GLOBAL-OPTIONS] install-file [FILES..]
137157
```
138158

139-
Install packages by specifying arguments:
159+
## 🔍 eask install-vc
140160

141-
```sh
142-
eask install auto-complete helm magit
143-
```
144-
145-
Or else, it will install the package from the current development:
161+
Install packages directly from the version control.
146162

147163
```sh
148-
eask install
164+
eask [GLOBAL-OPTIONS] install-vc [SPECS..]
149165
```
150166

151167
## 🔍 eask uninstall

0 commit comments

Comments
 (0)