diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-01 00:45:32 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-01 00:45:32 +0800 |
| commit | 8564c8f2177dec0c2c0c031d156347fa6b4485bc (patch) | |
| tree | 3c4abfd4ea943b243fc3adcb9a860da9dabd64b6 /scripts | |
| parent | 6c9e93b777238372ceb64dcbc168098f9f35385d (diff) | |
Add graceful fallback when jv command is unavailable
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/deploy/zsh_support/jvcs.plugin.zsh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/scripts/deploy/zsh_support/jvcs.plugin.zsh b/scripts/deploy/zsh_support/jvcs.plugin.zsh index 2032044..ff3f213 100644 --- a/scripts/deploy/zsh_support/jvcs.plugin.zsh +++ b/scripts/deploy/zsh_support/jvcs.plugin.zsh @@ -47,10 +47,17 @@ JVCS_UPSTREAM='' ################### jvcs_read_state() { - JVCS_WS="$(jv _workspace_dir)" - JVCS_ACCOUNT="$(jv _account)" - JVCS_SHEET="$(jv _sheet)" - JVCS_UPSTREAM="$(jv _upstream)" + if command -v jv &>/dev/null; then + JVCS_WS="$(jv _workspace_dir 2>/dev/null)" + JVCS_ACCOUNT="$(jv _account 2>/dev/null)" + JVCS_SHEET="$(jv _sheet 2>/dev/null)" + JVCS_UPSTREAM="$(jv _upstream 2>/dev/null)" + else + JVCS_WS='' + JVCS_ACCOUNT='' + JVCS_SHEET='' + JVCS_UPSTREAM='' + fi } ################## |
