easy-command 2.0.7 → 2.0.9

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/CHANGELOG.md ADDED
@@ -0,0 +1,44 @@
1
+ # Changelog
2
+
3
+ All notable changes to easy-command are documented here.
4
+
5
+ ## 2.0.9 - 2026-09-20
6
+
7
+ - Added a bundled changelog and linked it from both README files.
8
+
9
+ ## 2.0.8 - 2026-09-20
10
+
11
+ - `ec update` now upgrades the global npm CLI to `easy-command@latest` before updating managed repositories and shell configuration.
12
+ - Added `ec -v` and `ec --version`.
13
+ - Added npm Trusted Publishing through GitHub Actions, including provenance attestations.
14
+
15
+ ## 2.0.7 - 2026-09-20
16
+
17
+ - Directories are recorded only through explicit `ec add` / `ec a` or `z add` / `z a`.
18
+ - `ec <keyword>` and `z <keyword>` now only search and jump; they do not record a local matching directory implicitly.
19
+
20
+ ## 2.0.6 - 2026-09-20
21
+
22
+ - Added default Git aliases, including `st`, `br`, `sw`, `ci`, `cam`, `lg`, `la`, and `lb`.
23
+ - Existing user-defined Git aliases are never overwritten.
24
+
25
+ ## 2.0.5 - 2026-09-19
26
+
27
+ - Added global npm installation support.
28
+ - Added the `ec` unified directory and maintenance command interface.
29
+
30
+ ## 2.0.3 - 2026-09-18
31
+
32
+ - Added explicit zoxide directory registration shortcuts.
33
+
34
+ ## 2.0.2 - 2026-09-18
35
+
36
+ - Improved macOS installation compatibility.
37
+
38
+ ## 2.0.1 - 2026-09-18
39
+
40
+ - Released the 2.x installer improvements.
41
+
42
+ ## 1.0.4 - 2026-09-18
43
+
44
+ - Added the npm CLI entry point.
package/README.md CHANGED
@@ -8,6 +8,8 @@ Configure a polished Zsh terminal in one command.
8
8
 
9
9
  `easy-command` installs and configures Oh My Zsh, the `agnoster` theme, Git status, command suggestions, Tab completion, and syntax highlighting. It preserves your existing `.zshrc` content and creates a backup before every change.
10
10
 
11
+ See [CHANGELOG.md](CHANGELOG.md) for release notes.
12
+
11
13
  ## INSTALL
12
14
 
13
15
  ### npm (recommended)
@@ -131,13 +133,13 @@ bash install.sh -y
131
133
  For production, pin a release tag instead of running `main` directly:
132
134
 
133
135
  ```bash
134
- npx easy-command@2.0.7 -y
136
+ npx easy-command@2.0.9 -y
135
137
  ```
136
138
 
137
139
  Or, without npm:
138
140
 
139
141
  ```bash
140
- curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.7/install.sh | bash -s -- -y
142
+ curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.9/install.sh | bash -s -- -y
141
143
  ```
142
144
 
143
145
  ## License
package/README_CN.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  `easy-command` 会安装并配置 Oh My Zsh、`agnoster` 主题、Git 状态、命令建议、Tab 补全和语法高亮。每次修改 `.zshrc` 前都会备份,并保留用户已有的配置内容。
10
10
 
11
+ 更新记录见 [CHANGELOG.md](CHANGELOG.md)。
12
+
11
13
  ## 安装
12
14
 
13
15
  ### npm 安装(推荐)
@@ -131,13 +133,13 @@ bash install.sh -y
131
133
  生产环境建议固定到发布标签,而不是直接使用 `main`:
132
134
 
133
135
  ```bash
134
- npx easy-command@2.0.7 -y
136
+ npx easy-command@2.0.9 -y
135
137
  ```
136
138
 
137
139
  或者不使用 npm:
138
140
 
139
141
  ```bash
140
- curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.7/install.sh | bash -s -- -y
142
+ curl -fsSL https://raw.githubusercontent.com/UnionSchool/easy-command/v2.0.9/install.sh | bash -s -- -y
141
143
  ```
142
144
 
143
145
  ## 许可
package/bin/easy-command CHANGED
@@ -10,4 +10,4 @@ while [[ -h "$source_path" ]]; do
10
10
  done
11
11
 
12
12
  package_directory="$(cd -P "$(dirname "$source_path")/.." && pwd)"
13
- exec "$package_directory/install.sh" "$@"
13
+ exec env EASY_COMMAND_NPM_CLI=1 "$package_directory/install.sh" "$@"
package/install.sh CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  set -Eeuo pipefail
4
4
 
5
- readonly VERSION='2.0.7'
5
+ readonly VERSION='2.0.9'
6
6
  readonly BEGIN_MARKER='# >>> easy-command zsh >>>'
7
7
  readonly END_MARKER='# <<< easy-command zsh <<<'
8
8
  readonly BASE_DIR_NAME='.easy-command'
@@ -48,6 +48,7 @@ Options:
48
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
+ --version, -v Print the easy-command version.
51
52
  --uninstall Remove only the easy-command managed .zshrc block.
52
53
  --help, -h Show this help.
53
54
  EOF
@@ -202,6 +203,24 @@ install_global_package() {
202
203
  fi
203
204
  }
204
205
 
206
+ update_global_package() {
207
+ [[ "${EASY_COMMAND_NPM_CLI:-}" == '1' ]] || return 0
208
+ [[ "${EASY_COMMAND_SELF_UPDATED:-}" != '1' ]] || return 0
209
+ command -v npm >/dev/null 2>&1 || {
210
+ warn 'npm is unavailable; skipped easy-command CLI upgrade.'
211
+ return 0
212
+ }
213
+
214
+ if "$DRY_RUN"; then
215
+ command_preview npm install -g easy-command@latest
216
+ return 0
217
+ fi
218
+
219
+ info 'Updating easy-command CLI to the latest npm version...'
220
+ npm install -g easy-command@latest || fail 'Unable to update easy-command CLI. Check npm permissions and registry settings, then retry.'
221
+ exec env EASY_COMMAND_NPM_CLI=1 EASY_COMMAND_SELF_UPDATED=1 easy-command update --yes --user "$TARGET_USER"
222
+ }
223
+
205
224
  ensure_repository() {
206
225
  local repository="$1"
207
226
  local destination="$2"
@@ -344,7 +363,7 @@ if command -v zoxide >/dev/null 2>&1; then
344
363
  command npx easy-command "$@"
345
364
  fi
346
365
  ;;
347
- --dry-run)
366
+ --dry-run|-v|--version)
348
367
  if (( $+commands[easy-command] )); then
349
368
  command easy-command "$@"
350
369
  else
@@ -567,6 +586,10 @@ parse_args() {
567
586
  --with-git-aliases) ENABLE_GIT_ALIASES=true ;;
568
587
  --without-git-aliases) ENABLE_GIT_ALIASES=false ;;
569
588
  --uninstall) ACTION='uninstall' ;;
589
+ --version|-v)
590
+ printf '%s\n' "$VERSION"
591
+ exit 0
592
+ ;;
570
593
  --help|-h)
571
594
  usage
572
595
  exit 0
@@ -616,6 +639,7 @@ main() {
616
639
  update)
617
640
  CHANGE_LOGIN_SHELL=false
618
641
  confirm "Update easy-command repositories for $TARGET_USER?"
642
+ update_global_package
619
643
  ensure_repositories
620
644
  update_repositories
621
645
  write_zshrc_block
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-command",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Configure a polished Zsh terminal with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "bin",
11
11
  "assets",
12
12
  "install.sh",
13
+ "CHANGELOG.md",
13
14
  "README.md",
14
15
  "README_CN.md",
15
16
  "LICENSE"