easy-command 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/README_CN.md +3 -3
- package/install.sh +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ bash install.sh --uninstall
|
|
|
95
95
|
bash install.sh -y --with-fzf
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
`zoxide` is installed by default. It enables `z <keyword>` directory jumping and `z add <directory>` (or `z a <directory>`) for manually recording a directory. Use `--without-zoxide` to disable it. `fzf` adds fuzzy history and file searching. Git aliases are added by default, including `git st`, `git br`, `git sw`, `git ci`, `git cam`, `git lg`, `git la`, `git lb`, and `git ec-status`; existing aliases are never overwritten. Use `--without-git-aliases` to skip or remove aliases managed by easy-command.
|
|
98
|
+
`zoxide` is installed by default. It enables `z <keyword>` directory jumping and `z add <directory>` (or `z a <directory>`) for manually recording a directory. Directories are recorded only through `z add`, `z a`, `ec add`, or `ec a`; normal jumps never add a directory automatically. Use `--without-zoxide` to disable it. `fzf` adds fuzzy history and file searching. Git aliases are added by default, including `git st`, `git br`, `git sw`, `git ci`, `git cam`, `git lg`, `git la`, `git lb`, and `git ec-status`; existing aliases are never overwritten. Use `--without-git-aliases` to skip or remove aliases managed by easy-command.
|
|
99
99
|
|
|
100
100
|
For a unified interface, use `ec <keyword>` to jump, `ec add <directory>` (or `ec a <directory>`) to record a directory, `ec list` (or `ec l`) to view entries, and `ec del <directory>` (or `ec remove <directory>`) to remove one. `ec doctor`, `ec repair`, `ec update`, `ec install`, `ec uninstall`, and `ec --dry-run` run the matching easy-command maintenance operation. `z` remains available for zoxide compatibility.
|
|
101
101
|
|
|
@@ -131,13 +131,13 @@ bash install.sh -y
|
|
|
131
131
|
For production, pin a release tag instead of running `main` directly:
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
npx easy-command@2.0.
|
|
134
|
+
npx easy-command@2.0.7 -y
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
Or, without npm:
|
|
138
138
|
|
|
139
139
|
```bash
|
|
140
|
-
curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.
|
|
140
|
+
curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.7/install.sh | bash -s -- -y
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
## License
|
package/README_CN.md
CHANGED
|
@@ -95,7 +95,7 @@ bash install.sh --uninstall
|
|
|
95
95
|
bash install.sh -y --with-fzf
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
默认安装 `zoxide`,可使用 `z <关键词>` 跳转目录,也支持 `z add <目录>` 或 `z a <目录>`
|
|
98
|
+
默认安装 `zoxide`,可使用 `z <关键词>` 跳转目录,也支持 `z add <目录>` 或 `z a <目录>` 手动记录目录;目录仅会通过 `z add`、`z a`、`ec add` 或 `ec a` 显式记录,普通跳转不会自动添加目录。使用 `--without-zoxide` 可关闭。`fzf` 提供历史命令和文件的模糊搜索;默认添加 Git 快捷操作,包括 `git st`、`git br`、`git sw`、`git ci`、`git cam`、`git lg`、`git la`、`git lb` 和 `git ec-status` 等,不会覆盖已有同名别名。使用 `--without-git-aliases` 可跳过或移除项目管理的快捷方式。
|
|
99
99
|
|
|
100
100
|
统一入口使用 `ec`:`ec <关键词>` 跳转目录,`ec add <目录>` 或 `ec a <目录>` 记录目录,`ec list` 或 `ec l` 查看记录,`ec del <目录>` 或 `ec remove <目录>` 删除记录;`ec doctor`、`ec repair`、`ec update`、`ec install`、`ec uninstall` 和 `ec --dry-run` 执行对应的 easy-command 维护操作。为兼容 zoxide,原有 `z` 命令仍可使用。
|
|
101
101
|
|
|
@@ -131,13 +131,13 @@ bash install.sh -y
|
|
|
131
131
|
生产环境建议固定到发布标签,而不是直接使用 `main`:
|
|
132
132
|
|
|
133
133
|
```bash
|
|
134
|
-
npx easy-command@2.0.
|
|
134
|
+
npx easy-command@2.0.7 -y
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
或者不使用 npm:
|
|
138
138
|
|
|
139
139
|
```bash
|
|
140
|
-
curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.
|
|
140
|
+
curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.7/install.sh | bash -s -- -y
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
## 许可
|
package/install.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
set -Eeuo pipefail
|
|
4
4
|
|
|
5
|
-
readonly VERSION='2.0.
|
|
5
|
+
readonly VERSION='2.0.7'
|
|
6
6
|
readonly BEGIN_MARKER='# >>> easy-command zsh >>>'
|
|
7
7
|
readonly END_MARKER='# <<< easy-command zsh <<<'
|
|
8
8
|
readonly BASE_DIR_NAME='.easy-command'
|
|
@@ -315,15 +315,22 @@ EOF
|
|
|
315
315
|
|
|
316
316
|
# easy-command: zoxide
|
|
317
317
|
if command -v zoxide >/dev/null 2>&1; then
|
|
318
|
-
|
|
318
|
+
# Paths are recorded only through `ec add` / `ec a`; never implicitly after cd.
|
|
319
|
+
eval "$(zoxide init zsh --no-cmd --hook none)"
|
|
319
320
|
|
|
320
|
-
|
|
321
|
+
function __easy_command_jump() {
|
|
322
|
+
local target
|
|
323
|
+
target="$(command zoxide query --exclude "$PWD" -- "$@")" || return 1
|
|
324
|
+
builtin cd -- "$target"
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
# Keep z for zoxide compatibility, but record paths only when explicitly requested.
|
|
321
328
|
function z() {
|
|
322
329
|
if [[ "$1" == 'add' || "$1" == 'a' ]]; then
|
|
323
330
|
shift
|
|
324
331
|
command zoxide add "$@"
|
|
325
332
|
else
|
|
326
|
-
|
|
333
|
+
__easy_command_jump "$@"
|
|
327
334
|
fi
|
|
328
335
|
}
|
|
329
336
|
|
|
@@ -366,7 +373,7 @@ if command -v zoxide >/dev/null 2>&1; then
|
|
|
366
373
|
' ec --dry-run'
|
|
367
374
|
;;
|
|
368
375
|
*)
|
|
369
|
-
|
|
376
|
+
__easy_command_jump "$@"
|
|
370
377
|
;;
|
|
371
378
|
esac
|
|
372
379
|
}
|