easy-command 2.0.5 → 2.0.6
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 +5 -5
- package/README_CN.md +5 -5
- package/install.sh +24 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,11 +91,11 @@ bash install.sh -y --no-chsh
|
|
|
91
91
|
# Remove only the configuration block managed by easy-command
|
|
92
92
|
bash install.sh --uninstall
|
|
93
93
|
|
|
94
|
-
# Enable optional fuzzy search
|
|
95
|
-
bash install.sh -y --with-fzf
|
|
94
|
+
# Enable optional fuzzy search
|
|
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
|
|
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.
|
|
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.6 -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.6/install.sh | bash -s -- -y
|
|
141
141
|
```
|
|
142
142
|
|
|
143
143
|
## License
|
package/README_CN.md
CHANGED
|
@@ -91,11 +91,11 @@ bash install.sh -y --no-chsh
|
|
|
91
91
|
# 仅删除 easy-command 管理的 .zshrc 配置区块
|
|
92
92
|
bash install.sh --uninstall
|
|
93
93
|
|
|
94
|
-
#
|
|
95
|
-
bash install.sh -y --with-fzf
|
|
94
|
+
# 启用可选的模糊搜索
|
|
95
|
+
bash install.sh -y --with-fzf
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
默认安装 `zoxide`,可使用 `z <关键词>` 跳转目录,也支持 `z add <目录>` 或 `z a <目录>` 手动记录目录;使用 `--without-zoxide` 可关闭。`fzf`
|
|
98
|
+
默认安装 `zoxide`,可使用 `z <关键词>` 跳转目录,也支持 `z add <目录>` 或 `z 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.6 -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.6/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.6'
|
|
6
6
|
readonly BEGIN_MARKER='# >>> easy-command zsh >>>'
|
|
7
7
|
readonly END_MARKER='# <<< easy-command zsh <<<'
|
|
8
8
|
readonly BASE_DIR_NAME='.easy-command'
|
|
@@ -13,7 +13,7 @@ CHANGE_LOGIN_SHELL=true
|
|
|
13
13
|
DRY_RUN=false
|
|
14
14
|
ENABLE_ZOXIDE=true
|
|
15
15
|
ENABLE_FZF='auto'
|
|
16
|
-
ENABLE_GIT_ALIASES=
|
|
16
|
+
ENABLE_GIT_ALIASES=true
|
|
17
17
|
GLOBAL_INSTALL=false
|
|
18
18
|
TARGET_USER="${SUDO_USER:-${USER}}"
|
|
19
19
|
TARGET_HOME=''
|
|
@@ -45,7 +45,7 @@ Options:
|
|
|
45
45
|
--without-zoxide Do not install or enable zoxide.
|
|
46
46
|
--with-fzf Enable optional fzf history and file searching.
|
|
47
47
|
--without-fzf Disable fzf in the managed configuration.
|
|
48
|
-
--with-git-aliases Add non-conflicting global Git aliases
|
|
48
|
+
--with-git-aliases Add non-conflicting global Git aliases (default).
|
|
49
49
|
--without-git-aliases
|
|
50
50
|
Remove global Git aliases managed by easy-command.
|
|
51
51
|
--uninstall Remove only the easy-command managed .zshrc block.
|
|
@@ -397,9 +397,29 @@ EOF
|
|
|
397
397
|
|
|
398
398
|
configure_git_aliases() {
|
|
399
399
|
local enabled
|
|
400
|
-
enabled="$
|
|
400
|
+
enabled="$ENABLE_GIT_ALIASES"
|
|
401
401
|
|
|
402
402
|
local aliases=(
|
|
403
|
+
'st=status'
|
|
404
|
+
'br=branch'
|
|
405
|
+
'bc=branch'
|
|
406
|
+
'sw=switch'
|
|
407
|
+
'cd=switch'
|
|
408
|
+
'ch=checkout'
|
|
409
|
+
'ck=checkout'
|
|
410
|
+
'ci=commit'
|
|
411
|
+
'ca=commit -a'
|
|
412
|
+
'cam=commit -a -m'
|
|
413
|
+
'co=commit'
|
|
414
|
+
'rb=rebase'
|
|
415
|
+
'rs=restore'
|
|
416
|
+
'rt=remote'
|
|
417
|
+
'mg=merge'
|
|
418
|
+
'rh=reset HEAD'
|
|
419
|
+
'last=log -1'
|
|
420
|
+
"lg=log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
|
|
421
|
+
'la=log --pretty=oneline --abbrev-commit'
|
|
422
|
+
'lb=log --graph --pretty=oneline --abbrev-commit'
|
|
403
423
|
'ec-status=status --short --branch'
|
|
404
424
|
'ec-log=log --oneline --graph --decorate -12'
|
|
405
425
|
'ec-last=log -1 --stat'
|