mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-26 10:23:06 +01:00
Compare commits
31
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34aec8b799 | ||
|
|
82bfc95f7f | ||
|
|
58d76b0c10 | ||
|
|
1195c3a15e | ||
|
|
f68e5ec392 | ||
|
|
27506acc8a | ||
|
|
109270911c | ||
|
|
49a6348eac | ||
|
|
2aa7aed78b | ||
|
|
93b87c9c9a | ||
|
|
8a85fa2243 | ||
|
|
6c31a91a3e | ||
|
|
c52efbc756 | ||
|
|
e35c9b4b67 | ||
|
|
87aa1a9b89 | ||
|
|
ca0a63f0ee | ||
|
|
a7f4e49946 | ||
|
|
3ecde00d94 | ||
|
|
902761f897 | ||
|
|
c0140703a5 | ||
|
|
ffe93241cc | ||
|
|
ca82ba6831 | ||
|
|
e957b67eed | ||
|
|
6010fb6260 | ||
|
|
044bcbf82d | ||
|
|
2d03d8ac01 | ||
|
|
f5d571c66d | ||
|
|
cca3bdfbef | ||
|
|
59ff4d042e | ||
|
|
b509b1c6ed | ||
|
|
c483ff288d |
No files matched your search
@@ -16,7 +16,7 @@ jobs:
|
|||||||
contents: write # this is needed to push commits and branches
|
contents: write # this is needed to push commits and branches
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
|
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Authenticate as @ohmyzsh
|
- name: Authenticate as @ohmyzsh
|
||||||
id: generate-token
|
id: generate-token
|
||||||
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
|
||||||
with:
|
with:
|
||||||
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
|
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
|
||||||
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
certifi==2026.10.19
|
certifi==2026.10.23
|
||||||
charset-normalizer==3.5.2
|
charset-normalizer==3.5.2
|
||||||
idna==3.20
|
idna==3.20
|
||||||
PyYAML==6.0.3
|
PyYAML==6.0.3
|
||||||
requests==2.34.2
|
requests==2.34.2
|
||||||
semver==3.1.0
|
semver==3.1.2
|
||||||
urllib3==2.8.0
|
urllib3==2.8.0
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- macos-latest
|
- macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
|
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
|
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jobs:
|
|||||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
|
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -36,6 +36,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
for file in ./oh-my-zsh.sh \
|
for file in ./oh-my-zsh.sh \
|
||||||
./lib/*.zsh \
|
./lib/*.zsh \
|
||||||
|
./functions/* \
|
||||||
|
./completions/_* \
|
||||||
./plugins/*/*.plugin.zsh \
|
./plugins/*/*.plugin.zsh \
|
||||||
./plugins/*/_* \
|
./plugins/*/_* \
|
||||||
./themes/*.zsh-theme; do
|
./themes/*.zsh-theme; do
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ jobs:
|
|||||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
|
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
- name: Authenticate as @ohmyzsh
|
- name: Authenticate as @ohmyzsh
|
||||||
id: generate-token
|
id: generate-token
|
||||||
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
|
uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
|
||||||
with:
|
with:
|
||||||
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
|
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
|
||||||
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Harden the runner (Audit all outbound calls)
|
- name: Harden the runner (Audit all outbound calls)
|
||||||
uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
|
uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
|
||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: "Run analysis"
|
- name: "Run analysis"
|
||||||
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
|
uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
|
||||||
with:
|
with:
|
||||||
results_file: results.sarif
|
results_file: results.sarif
|
||||||
results_format: sarif
|
results_format: sarif
|
||||||
@@ -60,6 +60,6 @@ jobs:
|
|||||||
retention-days: 5
|
retention-days: 5
|
||||||
|
|
||||||
- name: "Upload to code-scanning"
|
- name: "Upload to code-scanning"
|
||||||
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
|
||||||
with:
|
with:
|
||||||
sarif_file: results.sarif
|
sarif_file: results.sarif
|
||||||
@@ -552,6 +552,20 @@ omz update
|
|||||||
|
|
||||||
Magic! 🎉
|
Magic! 🎉
|
||||||
|
|
||||||
|
## Diagnostics
|
||||||
|
|
||||||
|
If something looks off (glitched characters, completions misbehaving), run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
omz diagnose
|
||||||
|
```
|
||||||
|
|
||||||
|
It runs a few quick checks and tells you what to fix — for example, it will warn you when
|
||||||
|
your locale is not UTF-8, which is a common cause of duplicated characters at the prompt
|
||||||
|
(see the [FAQ](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-see-duplicate-typed-characters-after-i-complete-a-command)).
|
||||||
|
|
||||||
|
For a full report suitable for attaching to a bug report, use `omz_diagnostic_dump`.
|
||||||
|
|
||||||
## Uninstalling Oh My Zsh
|
## Uninstalling Oh My Zsh
|
||||||
|
|
||||||
Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
|
Oh My Zsh isn't for everyone. We'll miss you, but we want to make this an easy breakup.
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
#compdef omz
|
||||||
|
|
||||||
|
local -a cmds subcmds
|
||||||
|
cmds=(
|
||||||
|
'changelog:Print the changelog'
|
||||||
|
'diagnose:Run configuration diagnostics'
|
||||||
|
'help:Usage information'
|
||||||
|
'plugin:Manage plugins'
|
||||||
|
'pr:Manage Oh My Zsh Pull Requests'
|
||||||
|
'reload:Reload the current zsh session'
|
||||||
|
'shellsaver:Launch a whimsical terminal screensaver'
|
||||||
|
'shop:Open the Oh My Zsh shop'
|
||||||
|
'theme:Manage themes'
|
||||||
|
'update:Update Oh My Zsh'
|
||||||
|
'version:Show the version'
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ "$words[2]" == (screensaver|shellsaver) ]] && (( CURRENT > 2 )); then
|
||||||
|
_arguments \
|
||||||
|
'1:command:' \
|
||||||
|
'2::scene:(aquarium logo hermit party)' \
|
||||||
|
'--list[List available scenes]' \
|
||||||
|
'--mono[Use the default foreground color]' \
|
||||||
|
'--seconds[Exit after a number of seconds]:seconds:' \
|
||||||
|
'--snapshot[Print a plain-text still]::frame:' \
|
||||||
|
'--help[Show Shellsaver help]'
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( CURRENT == 2 )); then
|
||||||
|
_describe 'command' cmds
|
||||||
|
elif (( CURRENT == 3 )); then
|
||||||
|
case "$words[2]" in
|
||||||
|
changelog) local -a refs
|
||||||
|
refs=("${(@f)$(builtin cd -q "$ZSH"; command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}")
|
||||||
|
_describe 'command' refs ;;
|
||||||
|
plugin) subcmds=(
|
||||||
|
'disable:Disable plugin(s)'
|
||||||
|
'enable:Enable plugin(s)'
|
||||||
|
'info:Get plugin information'
|
||||||
|
'list:List plugins'
|
||||||
|
'load:Load plugin(s)'
|
||||||
|
)
|
||||||
|
_describe 'command' subcmds ;;
|
||||||
|
pr) subcmds=('clean:Delete all Pull Request branches' 'test:Test a Pull Request')
|
||||||
|
_describe 'command' subcmds ;;
|
||||||
|
theme) subcmds=('list:List themes' 'set:Set a theme in your .zshrc file' 'use:Load a theme')
|
||||||
|
_describe 'command' subcmds ;;
|
||||||
|
esac
|
||||||
|
elif (( CURRENT == 4 )); then
|
||||||
|
case "${words[2]}::${words[3]}" in
|
||||||
|
plugin::(disable|enable|load))
|
||||||
|
local -aU valid_plugins
|
||||||
|
|
||||||
|
if [[ "${words[3]}" = disable ]]; then
|
||||||
|
# if command is "disable", only offer already enabled plugins
|
||||||
|
valid_plugins=($plugins)
|
||||||
|
else
|
||||||
|
valid_plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t))
|
||||||
|
# if command is "enable", remove already enabled plugins
|
||||||
|
[[ "${words[3]}" = enable ]] && valid_plugins=(${valid_plugins:|plugins})
|
||||||
|
fi
|
||||||
|
|
||||||
|
_describe 'plugin' valid_plugins ;;
|
||||||
|
plugin::info)
|
||||||
|
local -aU plugins
|
||||||
|
plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t))
|
||||||
|
_describe 'plugin' plugins ;;
|
||||||
|
plugin::list)
|
||||||
|
local -a opts
|
||||||
|
opts=('--enabled:List enabled plugins only')
|
||||||
|
_describe -o 'options' opts ;;
|
||||||
|
theme::(set|use))
|
||||||
|
local -aU themes
|
||||||
|
themes=("$ZSH"/themes/*.zsh-theme(-.N:t:r) "$ZSH_CUSTOM"/**/*.zsh-theme(-.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::))
|
||||||
|
_describe 'theme' themes ;;
|
||||||
|
esac
|
||||||
|
elif (( CURRENT > 4 )); then
|
||||||
|
case "${words[2]}::${words[3]}" in
|
||||||
|
plugin::(enable|disable|load))
|
||||||
|
local -aU valid_plugins
|
||||||
|
|
||||||
|
if [[ "${words[3]}" = disable ]]; then
|
||||||
|
# if command is "disable", only offer already enabled plugins
|
||||||
|
valid_plugins=($plugins)
|
||||||
|
else
|
||||||
|
valid_plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t))
|
||||||
|
# if command is "enable", remove already enabled plugins
|
||||||
|
[[ "${words[3]}" = enable ]] && valid_plugins=(${valid_plugins:|plugins})
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remove plugins already passed as arguments
|
||||||
|
# NOTE: $(( CURRENT - 1 )) is the last plugin argument completely passed, i.e. that which
|
||||||
|
# has a space after them. This is to avoid removing plugins partially passed, which makes
|
||||||
|
# the completion not add a space after the completed plugin.
|
||||||
|
local -a args
|
||||||
|
args=(${words[4,$(( CURRENT - 1))]})
|
||||||
|
valid_plugins=(${valid_plugins:|args})
|
||||||
|
|
||||||
|
_describe 'plugin' valid_plugins ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
+26
-111
@@ -1,5 +1,3 @@
|
|||||||
#!/usr/bin/env zsh
|
|
||||||
|
|
||||||
function omz {
|
function omz {
|
||||||
setopt localoptions noksharrays
|
setopt localoptions noksharrays
|
||||||
[[ $# -gt 0 ]] || {
|
[[ $# -gt 0 ]] || {
|
||||||
@@ -20,115 +18,6 @@ function omz {
|
|||||||
_omz::$command "$@"
|
_omz::$command "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
function _omz {
|
|
||||||
local -a cmds subcmds
|
|
||||||
cmds=(
|
|
||||||
'changelog:Print the changelog'
|
|
||||||
'help:Usage information'
|
|
||||||
'plugin:Manage plugins'
|
|
||||||
'pr:Manage Oh My Zsh Pull Requests'
|
|
||||||
'reload:Reload the current zsh session'
|
|
||||||
'shellsaver:Launch a whimsical terminal screensaver'
|
|
||||||
'shop:Open the Oh My Zsh shop'
|
|
||||||
'theme:Manage themes'
|
|
||||||
'update:Update Oh My Zsh'
|
|
||||||
'version:Show the version'
|
|
||||||
)
|
|
||||||
|
|
||||||
if [[ "$words[2]" == (screensaver|shellsaver) ]] && (( CURRENT > 2 )); then
|
|
||||||
_arguments \
|
|
||||||
'1:command:' \
|
|
||||||
'2::scene:(aquarium logo hermit party)' \
|
|
||||||
'--list[List available scenes]' \
|
|
||||||
'--mono[Use the default foreground color]' \
|
|
||||||
'--seconds[Exit after a number of seconds]:seconds:' \
|
|
||||||
'--snapshot[Print a plain-text still]::frame:' \
|
|
||||||
'--help[Show Shellsaver help]'
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (( CURRENT == 2 )); then
|
|
||||||
_describe 'command' cmds
|
|
||||||
elif (( CURRENT == 3 )); then
|
|
||||||
case "$words[2]" in
|
|
||||||
changelog) local -a refs
|
|
||||||
refs=("${(@f)$(builtin cd -q "$ZSH"; command git for-each-ref --format="%(refname:short):%(subject)" refs/heads refs/tags)}")
|
|
||||||
_describe 'command' refs ;;
|
|
||||||
plugin) subcmds=(
|
|
||||||
'disable:Disable plugin(s)'
|
|
||||||
'enable:Enable plugin(s)'
|
|
||||||
'info:Get plugin information'
|
|
||||||
'list:List plugins'
|
|
||||||
'load:Load plugin(s)'
|
|
||||||
)
|
|
||||||
_describe 'command' subcmds ;;
|
|
||||||
pr) subcmds=('clean:Delete all Pull Request branches' 'test:Test a Pull Request')
|
|
||||||
_describe 'command' subcmds ;;
|
|
||||||
theme) subcmds=('list:List themes' 'set:Set a theme in your .zshrc file' 'use:Load a theme')
|
|
||||||
_describe 'command' subcmds ;;
|
|
||||||
esac
|
|
||||||
elif (( CURRENT == 4 )); then
|
|
||||||
case "${words[2]}::${words[3]}" in
|
|
||||||
plugin::(disable|enable|load))
|
|
||||||
local -aU valid_plugins
|
|
||||||
|
|
||||||
if [[ "${words[3]}" = disable ]]; then
|
|
||||||
# if command is "disable", only offer already enabled plugins
|
|
||||||
valid_plugins=($plugins)
|
|
||||||
else
|
|
||||||
valid_plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t))
|
|
||||||
# if command is "enable", remove already enabled plugins
|
|
||||||
[[ "${words[3]}" = enable ]] && valid_plugins=(${valid_plugins:|plugins})
|
|
||||||
fi
|
|
||||||
|
|
||||||
_describe 'plugin' valid_plugins ;;
|
|
||||||
plugin::info)
|
|
||||||
local -aU plugins
|
|
||||||
plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t))
|
|
||||||
_describe 'plugin' plugins ;;
|
|
||||||
plugin::list)
|
|
||||||
local -a opts
|
|
||||||
opts=('--enabled:List enabled plugins only')
|
|
||||||
_describe -o 'options' opts ;;
|
|
||||||
theme::(set|use))
|
|
||||||
local -aU themes
|
|
||||||
themes=("$ZSH"/themes/*.zsh-theme(-.N:t:r) "$ZSH_CUSTOM"/**/*.zsh-theme(-.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::))
|
|
||||||
_describe 'theme' themes ;;
|
|
||||||
esac
|
|
||||||
elif (( CURRENT > 4 )); then
|
|
||||||
case "${words[2]}::${words[3]}" in
|
|
||||||
plugin::(enable|disable|load))
|
|
||||||
local -aU valid_plugins
|
|
||||||
|
|
||||||
if [[ "${words[3]}" = disable ]]; then
|
|
||||||
# if command is "disable", only offer already enabled plugins
|
|
||||||
valid_plugins=($plugins)
|
|
||||||
else
|
|
||||||
valid_plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t))
|
|
||||||
# if command is "enable", remove already enabled plugins
|
|
||||||
[[ "${words[3]}" = enable ]] && valid_plugins=(${valid_plugins:|plugins})
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove plugins already passed as arguments
|
|
||||||
# NOTE: $(( CURRENT - 1 )) is the last plugin argument completely passed, i.e. that which
|
|
||||||
# has a space after them. This is to avoid removing plugins partially passed, which makes
|
|
||||||
# the completion not add a space after the completed plugin.
|
|
||||||
local -a args
|
|
||||||
args=(${words[4,$(( CURRENT - 1))]})
|
|
||||||
valid_plugins=(${valid_plugins:|args})
|
|
||||||
|
|
||||||
_describe 'plugin' valid_plugins ;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# If run from a script, do not set the completion function
|
|
||||||
if (( ${+functions[compdef]} )); then
|
|
||||||
compdef _omz omz
|
|
||||||
fi
|
|
||||||
|
|
||||||
## Utility functions
|
## Utility functions
|
||||||
|
|
||||||
function _omz::confirm {
|
function _omz::confirm {
|
||||||
@@ -176,12 +65,36 @@ function _omz::log {
|
|||||||
|
|
||||||
## User-facing commands
|
## User-facing commands
|
||||||
|
|
||||||
|
function _omz::diagnose {
|
||||||
|
# Check the runtime locale: non-UTF-8 charsets are known to cause glitches
|
||||||
|
# such as duplicated characters at the prompt after completions.
|
||||||
|
# https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#i-see-duplicate-typed-characters-after-i-complete-a-command
|
||||||
|
#
|
||||||
|
# `lib/functions.zsh` loads the zsh/langinfo module at startup, so the
|
||||||
|
# CODESET parameter is already available without any subprocess; only fall
|
||||||
|
# back to `locale charmap` when that module is unavailable (zsh built without it).
|
||||||
|
local codeset="${langinfo[CODESET]:-}"
|
||||||
|
if [[ -z "$codeset" ]] && (( $+commands[locale] )); then
|
||||||
|
codeset="$(locale charmap 2>/dev/null)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${codeset:l}" = (utf-8|utf8) ]]; then
|
||||||
|
_omz::log info "locale charmap is UTF-8"
|
||||||
|
else
|
||||||
|
_omz::log warn "your locale is not UTF-8 (charmap: ${codeset:-unknown})"
|
||||||
|
_omz::log info "non-UTF-8 locales may cause glitches in completions and international characters"
|
||||||
|
_omz::log info "consider setting a UTF-8 locale, e.g.: export LANG=C.UTF-8"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
function _omz::help {
|
function _omz::help {
|
||||||
cat >&2 <<EOF
|
cat >&2 <<EOF
|
||||||
Usage: omz <command> [options]
|
Usage: omz <command> [options]
|
||||||
|
|
||||||
Available commands:
|
Available commands:
|
||||||
|
|
||||||
|
diagnose Run configuration diagnostics
|
||||||
help Print this help message
|
help Print this help message
|
||||||
changelog Print the changelog
|
changelog Print the changelog
|
||||||
plugin <command> Manage plugins
|
plugin <command> Manage plugins
|
||||||
@@ -974,3 +887,5 @@ function _omz::version {
|
|||||||
printf "%s (%s)\n" "$version" "$commit"
|
printf "%s (%s)\n" "$version" "$commit"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
omz "$@"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# diagnostics.zsh
|
# omz_diagnostic_dump
|
||||||
#
|
#
|
||||||
# Diagnostic and debugging support for oh-my-zsh
|
# Diagnostic and debugging support for oh-my-zsh
|
||||||
|
|
||||||
@@ -351,3 +351,5 @@ function _omz_diag_dump_os_specific_version() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
omz_diagnostic_dump "$@"
|
||||||
@@ -78,6 +78,10 @@ fpath=($ZSH/{functions,completions} $ZSH_CUSTOM/{functions,completions} $fpath)
|
|||||||
# Load all stock functions (from $fpath files) called below.
|
# Load all stock functions (from $fpath files) called below.
|
||||||
autoload -U compaudit compinit zrecompile
|
autoload -U compaudit compinit zrecompile
|
||||||
|
|
||||||
|
# The omz CLI and omz_diagnostic_dump are loaded on first use; -z keeps
|
||||||
|
# zsh-style loading under kshautoload so the trailing call runs once
|
||||||
|
autoload -Uz omz omz_diagnostic_dump
|
||||||
|
|
||||||
is_plugin() {
|
is_plugin() {
|
||||||
local base_dir=$1
|
local base_dir=$1
|
||||||
local name=$2
|
local name=$2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
alias-finder() {
|
alias-finder() {
|
||||||
local cmd=" " exact="" longer="" cheaper="" wordEnd="'?$" finder="" filter=""
|
local c="" cmd=" " exact="" longer="" cheaper="" wordEnd="'?$" finder="" filter="" cmdLen=""
|
||||||
|
|
||||||
# build command and options
|
# build command and options
|
||||||
for c in "$@"; do
|
for c in "$@"; do
|
||||||
@@ -19,11 +19,15 @@ alias-finder() {
|
|||||||
zstyle -t ':omz:plugins:alias-finder' cheaper && cheaper=true
|
zstyle -t ':omz:plugins:alias-finder' cheaper && cheaper=true
|
||||||
|
|
||||||
# format cmd for grep
|
# format cmd for grep
|
||||||
## - replace newlines with spaces
|
## - replace newlines and multiple spaces with one space
|
||||||
## - trim both ends
|
## - trim both ends
|
||||||
## - replace multiple spaces with one space
|
|
||||||
## - add escaping character to special characters
|
## - add escaping character to special characters
|
||||||
cmd=$(echo -n "$cmd" | tr '\n' ' ' | xargs | tr -s '[:space:]' | sed 's/[].\|$(){}?+*^[]/\\&/g')
|
setopt localoptions extendedglob
|
||||||
|
cmd=${cmd//[[:space:]]##/ }
|
||||||
|
cmd=${cmd# }
|
||||||
|
cmd=${cmd% }
|
||||||
|
local esc_pattern='(#m)[][.\\|$(){}?+*^]' MATCH MBEGIN MEND
|
||||||
|
cmd=${cmd//${~esc_pattern}/\\$MATCH}
|
||||||
|
|
||||||
if [[ $longer == true ]]; then
|
if [[ $longer == true ]]; then
|
||||||
wordEnd="" # remove wordEnd to find longer aliases
|
wordEnd="" # remove wordEnd to find longer aliases
|
||||||
@@ -35,7 +39,7 @@ alias-finder() {
|
|||||||
|
|
||||||
# make filter to find only shorter results than current cmd
|
# make filter to find only shorter results than current cmd
|
||||||
if [[ $cheaper == true ]]; then
|
if [[ $cheaper == true ]]; then
|
||||||
cmdLen=$(echo -n "$cmd" | wc -c)
|
cmdLen=${#cmd}
|
||||||
if [[ $cmdLen -le 1 ]]; then
|
if [[ $cmdLen -le 1 ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Bitwarden plugin
|
||||||
|
|
||||||
|
This plugin adds Zsh completions for whichever Bitwarden CLIs are installed:
|
||||||
|
|
||||||
|
- [Bitwarden CLI (`bw`)](https://bitwarden.com/help/cli/)
|
||||||
|
- [Bitwarden Secrets Manager CLI (`bws`)](https://bitwarden.com/help/secrets-manager-cli/)
|
||||||
|
|
||||||
|
To enable it, add `bitwarden` to the plugins array in your `.zshrc`:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=(... bitwarden)
|
||||||
|
```
|
||||||
|
|
||||||
|
Each installed CLI generates and refreshes its own completion cache in the
|
||||||
|
background when the plugin loads. The cache files are
|
||||||
|
`$ZSH_CACHE_DIR/completions/_bw` and `$ZSH_CACHE_DIR/completions/_bws`.
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# Autocompletion for the Bitwarden CLI (bw) and Secrets Manager CLI (bws).
|
||||||
|
() {
|
||||||
|
local cli completion cache_file
|
||||||
|
local -a generator_args
|
||||||
|
for cli in bw bws; do
|
||||||
|
completion="_$cli"
|
||||||
|
cache_file="$ZSH_CACHE_DIR/completions/$completion"
|
||||||
|
|
||||||
|
if (( ! $+commands[$cli] )); then
|
||||||
|
# compinit can register a cached completion after the CLI is removed.
|
||||||
|
if [[ -f "$cache_file" && ${_comps[$cli]-} == "$completion" ]]; then
|
||||||
|
unset "_comps[$cli]"
|
||||||
|
fi
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$cli" in
|
||||||
|
bw)
|
||||||
|
generator_args=(completion --shell zsh)
|
||||||
|
# bw emits function definitions. Use ksh-style autoload to run _bw
|
||||||
|
# on the first Tab press as well as loading its helper functions.
|
||||||
|
autoload -Uk "$completion"
|
||||||
|
;;
|
||||||
|
bws)
|
||||||
|
generator_args=(completions zsh)
|
||||||
|
autoload -Uz "$completion"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
# Register the completion if compinit hasn't picked it up yet.
|
||||||
|
if [[ -z ${_comps[$cli]-} ]]; then
|
||||||
|
_comps[$cli]=$completion
|
||||||
|
fi
|
||||||
|
|
||||||
|
() {
|
||||||
|
zmodload -F zsh/files b:zf_mv || return
|
||||||
|
local temp_file
|
||||||
|
temp_file=$(mktemp "${cache_file:h}/.$completion.XXXXXXXX") || return
|
||||||
|
if command "$cli" "$@" >| "$temp_file" && [[ -s "$temp_file" ]] &&
|
||||||
|
zf_mv -f -- "$temp_file" "$cache_file"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
rm -f -- "$temp_file"
|
||||||
|
} "${generator_args[@]}" &|
|
||||||
|
done
|
||||||
|
}
|
||||||
@@ -52,7 +52,7 @@ function push_future() {
|
|||||||
if [[ $#dirhistory_future -ge $DIRHISTORY_SIZE ]]; then
|
if [[ $#dirhistory_future -ge $DIRHISTORY_SIZE ]]; then
|
||||||
shift dirhistory_future
|
shift dirhistory_future
|
||||||
fi
|
fi
|
||||||
if [[ $#dirhistory_future -eq 0 || $dirhistory_futuret[$#dirhistory_future] != "$1" ]]; then
|
if [[ $#dirhistory_future -eq 0 || $dirhistory_future[$#dirhistory_future] != "$1" ]]; then
|
||||||
dirhistory_future+=($1)
|
dirhistory_future+=($1)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ takes preference, _i.e._ the .env file will never be sourced.
|
|||||||
## Named Pipe (FIFO) Support
|
## Named Pipe (FIFO) Support
|
||||||
|
|
||||||
The plugin supports `.env` files provided as UNIX named pipes (FIFOs) in addition to regular files.
|
The plugin supports `.env` files provided as UNIX named pipes (FIFOs) in addition to regular files.
|
||||||
This is useful when secrets managers like [1Password Environments](https://developer.1password.com/docs/environment/)
|
This is useful when secrets managers like [1Password Environments](https://developer.1password.com/docs/environments/)
|
||||||
mount `.env` files as named pipes to inject secrets on-the-fly without writing them to disk.
|
mount `.env` files as named pipes to inject secrets on-the-fly without writing them to disk.
|
||||||
|
|
||||||
No additional configuration is required — the plugin automatically detects and sources named pipes.
|
No additional configuration is required — the plugin automatically detects and sources named pipes.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ plugins=(... drush)
|
|||||||
| `drcr` | `drush core-cron` | Run all cron hooks in all active modules for specified site |
|
| `drcr` | `drush core-cron` | Run all cron hooks in all active modules for specified site |
|
||||||
| `drct` | `drush cc theme-registry` | Clear theme-registry cache |
|
| `drct` | `drush cc theme-registry` | Clear theme-registry cache |
|
||||||
| `drcv` | `drush cc views` | Clear views cache _(make sure that the views module is enabled)_ |
|
| `drcv` | `drush cc views` | Clear views cache _(make sure that the views module is enabled)_ |
|
||||||
| `drdmp` | `drush drush sql-dump --ordered-dump --result-file=dumpsql` | Backup database in a new dump.sql file |
|
| `drdmp` | `drush sql-dump --ordered-dump --result-file=dump.sql` | Backup database in a new dump.sql file |
|
||||||
| `drf` | `drush features` | Display features status |
|
| `drf` | `drush features` | Display features status |
|
||||||
| `drfr` | `drush features-revert -y` | Revert a feature module on your site |
|
| `drfr` | `drush features-revert -y` | Revert a feature module on your site |
|
||||||
| `drfra` | `drush features-revert-all` | Revert all enabled feature module on your site |
|
| `drfra` | `drush features-revert-all` | Revert all enabled feature module on your site |
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ case $state in
|
|||||||
'new' \
|
'new' \
|
||||||
'serve' \
|
'serve' \
|
||||||
'test' \
|
'test' \
|
||||||
'vesion' && ret=0
|
'version' && ret=0
|
||||||
;;
|
;;
|
||||||
addon)
|
addon)
|
||||||
_arguments \
|
_arguments \
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ Encode a file's contents to base64 and save output to text file.
|
|||||||
- From parameter
|
- From parameter
|
||||||
|
|
||||||
```console
|
```console
|
||||||
$ encodefile64 ohmyzsh.icn
|
$ encodefile64 oh-my-zsh
|
||||||
ohmyzsh.icn's content encoded in base64 and saved as ohmyzsh.icn.txt
|
oh-my-zsh's content encoded in base64 and saved as oh-my-zsh.txt
|
||||||
$ ef64 "oh-my-zsh"
|
$ ef64 "oh-my-zsh"
|
||||||
ohmyzsh.icn's content encoded in base64 and saved as ohmyzsh.icn.txt
|
oh-my-zsh's content encoded in base64 and saved as oh-my-zsh.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### Decoding
|
### Decoding
|
||||||
|
|||||||
@@ -2,24 +2,37 @@ encode64() {
|
|||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
cat | base64
|
cat | base64
|
||||||
else
|
else
|
||||||
printf '%s' $1 | base64
|
printf '%s' "$1" | base64
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
encodefile64() {
|
encodefile64() {
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -ne 1 || ! -f "$1" || ! -r "$1" ]]; then
|
||||||
echo "You must provide a filename"
|
print -u2 -- 'Usage: encodefile64 <file>'
|
||||||
else
|
return 1
|
||||||
base64 $1 > $1.txt
|
|
||||||
echo "${1}'s content encoded in base64 and saved as ${1}.txt"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local file="$1" output="${1}.txt" tmp_file
|
||||||
|
[[ $output == /* ]] || output="./$output"
|
||||||
|
|
||||||
|
tmp_file=$(mktemp "${output}.XXXXXX") || return 1
|
||||||
|
if ! base64 < "$file" > "$tmp_file"; then
|
||||||
|
command rm -f "$tmp_file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if ! command mv "$tmp_file" "$output"; then
|
||||||
|
command rm -f "$tmp_file"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
print -- "$file's content encoded in base64 and saved as ${file}.txt"
|
||||||
}
|
}
|
||||||
|
|
||||||
decode64() {
|
decode64() {
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
cat | base64 --decode
|
cat | base64 -d
|
||||||
else
|
else
|
||||||
printf '%s' $1 | base64 --decode
|
printf '%s' "$1" | base64 -d
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
alias e64=encode64
|
alias e64=encode64
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
emulate -LR zsh
|
||||||
|
|
||||||
|
source "${1:-${0:A:h:h}/encode64.plugin.zsh}"
|
||||||
|
|
||||||
|
test_dir=$(mktemp -d) || exit 1
|
||||||
|
trap 'command rm -rf -- "$test_dir"' EXIT
|
||||||
|
cd "$test_dir" || exit 1
|
||||||
|
|
||||||
|
typeset -i failures=0 tests=0
|
||||||
|
typeset output expected_output
|
||||||
|
|
||||||
|
check_result() {
|
||||||
|
local description="$1" expected_status="$2" expected_stdout="$3" expected_stderr="$4"
|
||||||
|
shift 4
|
||||||
|
|
||||||
|
output=$("$@" 2> "$test_dir/stderr")
|
||||||
|
local actual_status=$?
|
||||||
|
(( tests++ ))
|
||||||
|
|
||||||
|
if [[ $actual_status == $expected_status && $output == "$expected_stdout" && $(<"$test_dir/stderr") == "$expected_stderr" ]]; then
|
||||||
|
print -r -- "PASS: $description"
|
||||||
|
else
|
||||||
|
print -u2 -r -- "FAIL: $description"
|
||||||
|
print -u2 -r -- " status: $actual_status (expected $expected_status)"
|
||||||
|
print -u2 -r -- " stdout: ${(qqq)output} (expected ${(qqq)expected_stdout})"
|
||||||
|
print -u2 -r -- " stderr: $(<"$test_dir/stderr") (expected $expected_stderr)"
|
||||||
|
(( failures++ ))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_encode_arg() { encode64 'oh-my-zsh'; }
|
||||||
|
check_encode_empty() { encode64 ''; }
|
||||||
|
check_decode_arg() { decode64 'b2gtbXktenNo'; }
|
||||||
|
|
||||||
|
expected_output=$(printf '%s' 'oh-my-zsh' | base64)
|
||||||
|
check_result 'encode argument' 0 "$expected_output" '' check_encode_arg
|
||||||
|
check_result 'encode empty argument' 0 '' '' check_encode_empty
|
||||||
|
check_result 'decode argument' 0 'oh-my-zsh' '' check_decode_arg
|
||||||
|
|
||||||
|
file="$test_dir/file with spaces.txt"
|
||||||
|
print -r -- 'file contents' >| "$file"
|
||||||
|
encodefile64 "$file" > "$test_dir/stdout" 2> "$test_dir/stderr"
|
||||||
|
file_status=$?
|
||||||
|
expected_output=$(base64 < "$file")
|
||||||
|
(( tests++ ))
|
||||||
|
if [[ $file_status == 0 && $(<"${file}.txt") == "$expected_output" && $(<"$test_dir/stdout") == "$file's content encoded in base64 and saved as ${file}.txt" && ! -s "$test_dir/stderr" ]]; then
|
||||||
|
print -r -- 'PASS: encode file with spaces'
|
||||||
|
else
|
||||||
|
print -u2 -r -- 'FAIL: encode file with spaces'
|
||||||
|
(( failures++ ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
check_invalid_file() { encodefile64 ''; }
|
||||||
|
check_result 'empty filename' 1 '' 'Usage: encodefile64 <file>' check_invalid_file
|
||||||
|
if [[ -e .txt ]]; then
|
||||||
|
print -u2 -r -- 'FAIL: empty filename created .txt'
|
||||||
|
(( failures++ ))
|
||||||
|
command rm -f .txt
|
||||||
|
fi
|
||||||
|
|
||||||
|
print -r -- 'preserve existing output' >| "${file}.txt"
|
||||||
|
base64() { return 42; }
|
||||||
|
encodefile64 "$file" > "$test_dir/stdout" 2> "$test_dir/stderr"
|
||||||
|
file_status=$?
|
||||||
|
unset -f base64
|
||||||
|
(( tests++ ))
|
||||||
|
if [[ $file_status != 0 && $(<"${file}.txt") == 'preserve existing output' && ! -s "$test_dir/stdout" ]]; then
|
||||||
|
print -r -- 'PASS: failed encoding preserves existing output'
|
||||||
|
else
|
||||||
|
print -u2 -r -- 'FAIL: failed encoding preserves existing output'
|
||||||
|
(( failures++ ))
|
||||||
|
fi
|
||||||
|
|
||||||
|
print -r -- "$tests tests, $failures failures"
|
||||||
|
(( failures == 0 ))
|
||||||
@@ -7,6 +7,7 @@ if [[ -z "${CLOUDSDK_HOME}" ]]; then
|
|||||||
search_locations=(
|
search_locations=(
|
||||||
"$HOME/google-cloud-sdk"
|
"$HOME/google-cloud-sdk"
|
||||||
"/usr/local/share/google-cloud-sdk"
|
"/usr/local/share/google-cloud-sdk"
|
||||||
|
"/usr/local/google-cloud-sdk"
|
||||||
"/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
|
"/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
|
||||||
"/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
|
"/opt/homebrew/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
|
||||||
"/opt/homebrew/share/google-cloud-sdk"
|
"/opt/homebrew/share/google-cloud-sdk"
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ plugins=(... jj)
|
|||||||
|
|
||||||
## Prompt usage
|
## Prompt usage
|
||||||
|
|
||||||
Because `jj` has a very powerful [template syntax](https://martinvonz.github.io/jj/latest/templates/), this
|
Because `jj` has a very powerful [template syntax](https://docs.jj-vcs.dev/latest/templates/), this
|
||||||
plugin only exposes a convenience function `jj_prompt_template` to read information from the current change.
|
plugin only exposes a convenience function `jj_prompt_template` to read information from the current change.
|
||||||
It is basically the same as `jj log --no-graph -r @ -T $1`:
|
It is basically the same as `jj log --no-graph -r @ -T $1`:
|
||||||
|
|
||||||
|
|||||||
@@ -86,8 +86,7 @@ print(unquote_plus(sys.stdin.read()))
|
|||||||
function pp_json() {
|
function pp_json() {
|
||||||
ruby -e '
|
ruby -e '
|
||||||
require "json"
|
require "json"
|
||||||
require "yaml"
|
puts JSON.pretty_generate(JSON.parse(STDIN.read), indent: " ")
|
||||||
puts JSON.parse(STDIN.read).to_yaml
|
|
||||||
'
|
'
|
||||||
}
|
}
|
||||||
function is_json() {
|
function is_json() {
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Run with: zsh -df plugins/jsontools/tests/jsontools-ruby.test.zsh
|
||||||
|
emulate -L zsh
|
||||||
|
setopt err_return
|
||||||
|
|
||||||
|
(( $+commands[ruby] )) || {
|
||||||
|
print -u2 'These tests require Ruby.'
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONTOOLS_METHOD=ruby
|
||||||
|
source "${0:A:h:h}/jsontools.plugin.zsh"
|
||||||
|
local test_dir=$(mktemp -d)
|
||||||
|
|
||||||
|
check_output() {
|
||||||
|
local tool=$1 description=$2 expected_status=${3:-0}
|
||||||
|
local -i result=0
|
||||||
|
$tool < "$test_dir/input" > "$test_dir/actual" || result=$?
|
||||||
|
if (( result != expected_status )) \
|
||||||
|
|| ! cmp -s "$test_dir/expected" "$test_dir/actual"; then
|
||||||
|
print -u2 -r -- "FAIL: $description ($tool exited $result)"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
print -r -- "PASS: $description"
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
# pp_json prints JSON with the same 4-space indent as the node and python3 methods.
|
||||||
|
print -rn -- '{"value":42}' > "$test_dir/input"
|
||||||
|
printf '{\n "value": 42\n}\n' > "$test_dir/expected"
|
||||||
|
check_output pp_json 'pretty-print a small document'
|
||||||
|
|
||||||
|
print -rn -- '{"list":[1,"two"],"nested":{"a":null,"b":true}}' > "$test_dir/input"
|
||||||
|
printf '{\n "list": [\n 1,\n "two"\n ],\n "nested": {\n "a": null,\n "b": true\n }\n}\n' \
|
||||||
|
> "$test_dir/expected"
|
||||||
|
check_output pp_json 'pretty-print a nested document'
|
||||||
|
|
||||||
|
printf '{"a":1}\n[2]\n' > "$test_dir/input"
|
||||||
|
printf '{\n "a": 1\n}\n[\n 2\n]\n' > "$test_dir/expected"
|
||||||
|
check_output pp_ndjson 'pretty-print NDJSON'
|
||||||
|
|
||||||
|
print -rn -- '{"value":42}' > "$test_dir/input"
|
||||||
|
print -r -- true > "$test_dir/expected"
|
||||||
|
check_output is_json 'validate a document'
|
||||||
|
|
||||||
|
print -rn -- '{invalid}' > "$test_dir/input"
|
||||||
|
print -r -- false > "$test_dir/expected"
|
||||||
|
check_output is_json 'reject invalid JSON' 1
|
||||||
|
|
||||||
|
print 'All jsontools Ruby tests passed.'
|
||||||
|
} always {
|
||||||
|
rm -rf -- "$test_dir"
|
||||||
|
}
|
||||||
@@ -347,6 +347,13 @@ function listMavenCompletions {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
compctl -K listMavenCompletions mvn mvnw
|
# Completion, via compsys so that tools built on it (fzf-tab, etc.) can take over.
|
||||||
compctl -K listMavenCompletions mvn-color
|
_mvn() {
|
||||||
compctl -K listMavenCompletions mvn-or-mvnw
|
local -a commands
|
||||||
|
listMavenCompletions
|
||||||
|
# _describe splits entries on `:`, so escape it to keep goals like `dependency:tree`.
|
||||||
|
commands=("${(@)reply//:/\\:}")
|
||||||
|
_describe -t mvn-commands 'mvn command' commands
|
||||||
|
}
|
||||||
|
|
||||||
|
compdef _mvn mvn mvnw mvn-color mvn-or-mvnw
|
||||||
@@ -16,7 +16,7 @@ plugins=(... npm)
|
|||||||
| `npmS` | `npm i -S` | Install and save to dependencies in your package.json |
|
| `npmS` | `npm i -S` | Install and save to dependencies in your package.json |
|
||||||
| `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json |
|
| `npmD` | `npm i -D` | Install and save to dev-dependencies in your package.json |
|
||||||
| `npmF` | `npm i -f` | Force install from remote registries ignoring local cache |
|
| `npmF` | `npm i -f` | Force install from remote registries ignoring local cache |
|
||||||
| `npmE` | `PATH="$(npm bin)":"$PATH"` | Run command from node_modules folder based on current directory |
|
| `npmE` | `PATH="$(npm root)/.bin":"$PATH"` | Run command from node_modules folder based on current directory |
|
||||||
| `npmO` | `npm outdated` | Check which npm modules are outdated |
|
| `npmO` | `npm outdated` | Check which npm modules are outdated |
|
||||||
| `npmU` | `npm update` | Update all the packages listed to the latest version |
|
| `npmU` | `npm update` | Update all the packages listed to the latest version |
|
||||||
| `npmV` | `npm -v` | Check package versions |
|
| `npmV` | `npm -v` | Check package versions |
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ alias npmF='npm i -f'
|
|||||||
|
|
||||||
# Execute command from node_modules folder based on current directory
|
# Execute command from node_modules folder based on current directory
|
||||||
# i.e npmE gulp
|
# i.e npmE gulp
|
||||||
alias npmE='PATH="$(npm bin)":"$PATH"'
|
alias npmE='PATH="$(npm root)/.bin":"$PATH"'
|
||||||
|
|
||||||
# Check which npm modules are outdated
|
# Check which npm modules are outdated
|
||||||
alias npmO="npm outdated"
|
alias npmO="npm outdated"
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ plugins=(... poetry)
|
|||||||
| prm | `poetry remove` | Remove packages from `pyproject.toml` and uninstall them |
|
| prm | `poetry remove` | Remove packages from `pyproject.toml` and uninstall them |
|
||||||
| prun | `poetry run` | Executes the given command inside the project’s virtualenv |
|
| prun | `poetry run` | Executes the given command inside the project’s virtualenv |
|
||||||
| psad | `poetry self add` | Add the Poetry plugin and install dependencies to make it work |
|
| psad | `poetry self add` | Add the Poetry plugin and install dependencies to make it work |
|
||||||
| psh | `poetry shell` | Spawns a shell within the virtual environment. If one doesn’t exist, it will be created |
|
| psh | `poetry shell` | Spawns a shell within the virtual environment. With Poetry 2.0+ and no shell plugin, activates it with `poetry env activate` |
|
||||||
| pshw | `poetry show` | List all the available dependencies |
|
| pshw | `poetry show` | List all the available dependencies |
|
||||||
| pslt | `poetry show --latest` | List latest version of the dependencies |
|
| pslt | `poetry show --latest` | List latest version of the dependencies |
|
||||||
| psup | `poetry self update` | Update Poetry to the latest version (default) or to the specified version |
|
| psup | `poetry self update` | Update Poetry to the latest version (default) or to the specified version |
|
||||||
| psync | `poetry install --sync` | Synchronize your environment with the `poetry.lock` |
|
| psync | `poetry sync` | Synchronize your environment with the `poetry.lock` (`poetry install --sync` before Poetry 2.0) |
|
||||||
| ptree | `poetry show --tree` | List the dependencies as tree |
|
| ptree | `poetry show --tree` | List the dependencies as tree |
|
||||||
| pup | `poetry update` | Get the latest versions of the dependencies and to update the `poetry.lock` |
|
| pup | `poetry update` | Get the latest versions of the dependencies and to update the `poetry.lock` |
|
||||||
| pvinf | `poetry env info` | Get basic information about the currently activated virtualenv |
|
| pvinf | `poetry env info` | Get basic information about the currently activated virtualenv |
|
||||||
|
|||||||
@@ -14,11 +14,9 @@ alias ppub='poetry publish'
|
|||||||
alias prm='poetry remove'
|
alias prm='poetry remove'
|
||||||
alias prun='poetry run'
|
alias prun='poetry run'
|
||||||
alias psad='poetry self add'
|
alias psad='poetry self add'
|
||||||
alias psh='poetry shell'
|
|
||||||
alias pshw='poetry show'
|
alias pshw='poetry show'
|
||||||
alias pslt='poetry show --latest'
|
alias pslt='poetry show --latest'
|
||||||
alias psup='poetry self update'
|
alias psup='poetry self update'
|
||||||
alias psync='poetry install --sync'
|
|
||||||
alias ptree='poetry show --tree'
|
alias ptree='poetry show --tree'
|
||||||
alias pup='poetry update'
|
alias pup='poetry update'
|
||||||
alias pvinf='poetry env info'
|
alias pvinf='poetry env info'
|
||||||
@@ -26,6 +24,25 @@ alias pvoff='poetry config virtualenvs.create false'
|
|||||||
alias pvrm='poetry env remove'
|
alias pvrm='poetry env remove'
|
||||||
alias pvu='poetry env use'
|
alias pvu='poetry env use'
|
||||||
|
|
||||||
|
# Poetry 2.0 moved `poetry shell` to the poetry-plugin-shell plugin, so fall
|
||||||
|
# back to activating the virtualenv in the current shell when it's missing.
|
||||||
|
function psh {
|
||||||
|
if poetry shell --help &>/dev/null; then
|
||||||
|
poetry shell "$@"
|
||||||
|
else
|
||||||
|
eval "$(poetry env activate)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Poetry 2.0 replaced `poetry install --sync` with `poetry sync`.
|
||||||
|
function psync {
|
||||||
|
if poetry sync --help &>/dev/null; then
|
||||||
|
poetry sync "$@"
|
||||||
|
else
|
||||||
|
poetry install --sync "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Return immediately if poetry is not found
|
# Return immediately if poetry is not found
|
||||||
if (( ! $+commands[poetry] )); then
|
if (( ! $+commands[poetry] )); then
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Run with: zsh -df plugins/timer/tests/timer.test.zsh
|
||||||
|
emulate -L zsh
|
||||||
|
|
||||||
|
source "${0:A:h:h}/timer.plugin.zsh"
|
||||||
|
|
||||||
|
typeset -i failures=0 tests=0
|
||||||
|
|
||||||
|
check_duration() {
|
||||||
|
local precision=$1 duration=$2 expected=$3
|
||||||
|
local output=$(TIMER_PRECISION=$precision __timer_format_duration $duration)
|
||||||
|
(( tests++ ))
|
||||||
|
|
||||||
|
if [[ $output == "$expected" ]]; then
|
||||||
|
print -r -- "PASS: $duration with precision $precision -> $output"
|
||||||
|
else
|
||||||
|
print -u2 -r -- "FAIL: $duration with precision $precision -> $output (expected $expected)"
|
||||||
|
(( failures++ ))
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
check_duration 1 0.04 /0.0s
|
||||||
|
check_duration 1 3.04 /3.0s
|
||||||
|
check_duration 1 40.0 /40.0s
|
||||||
|
check_duration 1 59.94 /59.9s
|
||||||
|
check_duration 1 59.97 /1m0.0s
|
||||||
|
check_duration 1 61.5 /1m1.5s
|
||||||
|
check_duration 1 73.0 /1m13.0s
|
||||||
|
check_duration 1 119.97 /2m0.0s
|
||||||
|
check_duration 1 3599.99 /60m0.0s
|
||||||
|
check_duration 2 59.996 /1m0.00s
|
||||||
|
check_duration 2 0.02 /0.02s
|
||||||
|
check_duration 0 1.4 /1s
|
||||||
|
check_duration 0 59.6 /1m0s
|
||||||
|
check_duration 0 119.5 /2m0s
|
||||||
|
|
||||||
|
print -r -- "$tests tests, $failures failures"
|
||||||
|
(( failures == 0 ))
|
||||||
@@ -6,8 +6,14 @@ __timer_current_time() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
__timer_format_duration() {
|
__timer_format_duration() {
|
||||||
local mins=$(printf '%.0f' $(($(IFS='.' read int dec <<< "$1"; echo $int) / 60)))
|
local -i precision=${TIMER_PRECISION:-1}
|
||||||
local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins)))
|
local -i scale=$(( 10 ** precision ))
|
||||||
|
# Round to the displayed precision before splitting off the minutes,
|
||||||
|
# so that e.g. 59.97s is shown as 1m0.0s instead of 60.0s
|
||||||
|
local -i units
|
||||||
|
(( units = $1 * scale + 0.5 ))
|
||||||
|
local -i mins=$(( units / (60 * scale) ))
|
||||||
|
local secs=$(printf "%.${precision}f" $(( (units - 60 * scale * mins) / (scale * 1.0) )))
|
||||||
local duration_str=$(echo "${mins}m${secs}s")
|
local duration_str=$(echo "${mins}m${secs}s")
|
||||||
local format="${TIMER_FORMAT:-/%d}"
|
local format="${TIMER_FORMAT:-/%d}"
|
||||||
echo "${format//\%d/${duration_str#0m}}"
|
echo "${format//\%d/${duration_str#0m}}"
|
||||||
|
|||||||
+12
-12
@@ -15,18 +15,18 @@ The plugin also supports the following:
|
|||||||
|
|
||||||
## Aliases
|
## Aliases
|
||||||
|
|
||||||
| Alias | Command | Description |
|
| Alias | Command | Description |
|
||||||
| ---------- | -------------------------- | -------------------------------------------------------- |
|
| ---------- | -------------------------------------- | -------------------------------------------------------- |
|
||||||
| `ta` | tmux attach -t | Attach new tmux session to already running named session |
|
| `ta` | tmux attach -t | Attach new tmux session to already running named session |
|
||||||
| `tad` | tmux attach -d -t | Detach named tmux session |
|
| `tad` | tmux attach -d -t | Detach named tmux session |
|
||||||
| `tds` | `_tmux_directory_session` | Creates or attaches to a session for the current path |
|
| `tds` | `_tmux_directory_session` | Creates or attaches to a session for the current path |
|
||||||
| `tkss` | tmux kill-session -t | Terminate named running tmux session |
|
| `tkss` | tmux kill-session -t | Terminate named running tmux session |
|
||||||
| `tksv` | tmux kill-server | Terminate all running tmux sessions |
|
| `tksv` | tmux kill-server | Terminate all running tmux sessions |
|
||||||
| `tl` | tmux list-sessions | Displays a list of running tmux sessions |
|
| `tl` | tmux list-sessions | Displays a list of running tmux sessions |
|
||||||
| `to` | tmux new-session -A -s | Create or attach to a named tmux session |
|
| `to` | tmux new-session -A -s | Create or attach to a named tmux session |
|
||||||
| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session |
|
| `tmux` | `_zsh_tmux_plugin_run` | Start a new tmux session |
|
||||||
| `tmuxconf` | `$EDITOR $ZSH_TMUX_CONFIG` | Open .tmux.conf file with an editor |
|
| `tmuxconf` | `${(z)EDITOR:-vim} "$ZSH_TMUX_CONFIG"` | Open .tmux.conf file with an editor. |
|
||||||
| `ts` | tmux new-session -s | Create a new named tmux session |
|
| `ts` | tmux new-session -s | Create a new named tmux session |
|
||||||
|
|
||||||
## Configuration Variables
|
## Configuration Variables
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function _build_tmux_alias {
|
|||||||
|
|
||||||
alias tksv='tmux kill-server'
|
alias tksv='tmux kill-server'
|
||||||
alias tl='tmux list-sessions'
|
alias tl='tmux list-sessions'
|
||||||
alias tmuxconf='$EDITOR $ZSH_TMUX_CONFIG'
|
alias tmuxconf='${(z)EDITOR:-vim} "$ZSH_TMUX_CONFIG"'
|
||||||
|
|
||||||
_build_tmux_alias "ta" "attach" "-t"
|
_build_tmux_alias "ta" "attach" "-t"
|
||||||
_build_tmux_alias "tad" "attach -d" "-t"
|
_build_tmux_alias "tad" "attach -d" "-t"
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ Available search contexts are:
|
|||||||
| `wolframalpha` | `https://wolframalpha.com/input?i=` |
|
| `wolframalpha` | `https://wolframalpha.com/input?i=` |
|
||||||
| `archive` | `https://web.archive.org/web/*/` |
|
| `archive` | `https://web.archive.org/web/*/` |
|
||||||
| `scholar` | `https://scholar.google.com/scholar?q=` |
|
| `scholar` | `https://scholar.google.com/scholar?q=` |
|
||||||
| `ask` | `https://www.ask.com/web?q=` |
|
|
||||||
| `youtube` | `https://www.youtube.com/results?search_query=` |
|
| `youtube` | `https://www.youtube.com/results?search_query=` |
|
||||||
| `deepl` | `https://www.deepl.com/translator#auto/auto/` |
|
| `deepl` | `https://www.deepl.com/translator#auto/auto/` |
|
||||||
| `dockerhub` | `https://hub.docker.com/search?q=` |
|
| `dockerhub` | `https://hub.docker.com/search?q=` |
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ function web_search() {
|
|||||||
wolframalpha "https://www.wolframalpha.com/input/?i="
|
wolframalpha "https://www.wolframalpha.com/input/?i="
|
||||||
archive "https://web.archive.org/web/*/"
|
archive "https://web.archive.org/web/*/"
|
||||||
scholar "https://scholar.google.com/scholar?q="
|
scholar "https://scholar.google.com/scholar?q="
|
||||||
ask "https://www.ask.com/web?q="
|
|
||||||
youtube "https://www.youtube.com/results?search_query="
|
youtube "https://www.youtube.com/results?search_query="
|
||||||
deepl "https://www.deepl.com/translator#auto/auto/"
|
deepl "https://www.deepl.com/translator#auto/auto/"
|
||||||
dockerhub "https://hub.docker.com/search?q="
|
dockerhub "https://hub.docker.com/search?q="
|
||||||
@@ -89,7 +88,6 @@ alias stackoverflow='web_search stackoverflow'
|
|||||||
alias wolframalpha='web_search wolframalpha'
|
alias wolframalpha='web_search wolframalpha'
|
||||||
alias archive='web_search archive'
|
alias archive='web_search archive'
|
||||||
alias scholar='web_search scholar'
|
alias scholar='web_search scholar'
|
||||||
alias ask='web_search ask'
|
|
||||||
alias youtube='web_search youtube'
|
alias youtube='web_search youtube'
|
||||||
alias deepl='web_search deepl'
|
alias deepl='web_search deepl'
|
||||||
alias dockerhub='web_search dockerhub'
|
alias dockerhub='web_search dockerhub'
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ function my_git_prompt() {
|
|||||||
STATUS=""
|
STATUS=""
|
||||||
|
|
||||||
# is branch ahead?
|
# is branch ahead?
|
||||||
if $(echo "$(git log origin/$(git_current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if $(echo "$(git log @{upstream}..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
|
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# is branch behind?
|
# is branch behind?
|
||||||
if $(echo "$(git log HEAD..origin/$(git_current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
if $(echo "$(git log HEAD..@{upstream} 2> /dev/null)" | grep '^commit' &> /dev/null); then
|
||||||
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
|
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -119,12 +119,13 @@ function parse-commit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Return truncated hash of the reverted commit
|
# Return truncated hash of the reverted commit
|
||||||
|
# (12 characters, to match the commit hashes from `git log --abbrev=12`)
|
||||||
function commit:is-revert {
|
function commit:is-revert {
|
||||||
local subject="$1" body="$2"
|
local subject="$1" body="$2"
|
||||||
|
|
||||||
if [[ "$subject" = Revert* && \
|
if [[ "$subject" = Revert* && \
|
||||||
"$body" =~ "This reverts commit ([^.]+)\." ]]; then
|
"$body" =~ "This reverts commit ([^.]+)\." ]]; then
|
||||||
echo "${match[1]:0:7}"
|
echo "${match[1]:0:12}"
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -528,6 +528,7 @@ print_success() {
|
|||||||
"$(fmt_code "$(fmt_link ".zshrc" "file://$zdot/.zshrc" --text)")" \
|
"$(fmt_code "$(fmt_link ".zshrc" "file://$zdot/.zshrc" --text)")" \
|
||||||
"file to select plugins, themes, and options."
|
"file to select plugins, themes, and options."
|
||||||
printf '\n'
|
printf '\n'
|
||||||
|
printf '%s\n' "${FMT_YELLOW}★${FMT_RESET} Enjoying Oh My Zsh? Star us on $(fmt_link GitHub https://github.com/ohmyzsh/ohmyzsh)"
|
||||||
printf '%s\n' "• Follow along on X ($(fmt_link @ohmyzsh https://x.com/ohmyzsh)) or Bluesky ($(fmt_link @ohmyz.sh https://bsky.app/profile/ohmyz.sh))"
|
printf '%s\n' "• Follow along on X ($(fmt_link @ohmyzsh https://x.com/ohmyzsh)) or Bluesky ($(fmt_link @ohmyz.sh https://bsky.app/profile/ohmyz.sh))"
|
||||||
printf '%s\n' "• Questions or ideas? Join the community on $(fmt_link Discord https://discord.gg/ohmyzsh)"
|
printf '%s\n' "• Questions or ideas? Join the community on $(fmt_link Discord https://discord.gg/ohmyzsh)"
|
||||||
printf '%s\n' "• Help support the project: sponsor us on $(fmt_link "Open Collective" https://opencollective.com/ohmyzsh),"
|
printf '%s\n' "• Help support the project: sponsor us on $(fmt_link "Open Collective" https://opencollective.com/ohmyzsh),"
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
# Run with: zsh -df tools/tests/changelog.test.zsh
|
||||||
|
emulate -L zsh
|
||||||
|
setopt err_return
|
||||||
|
|
||||||
|
local changelog="${0:A:h:h}/changelog.sh"
|
||||||
|
local test_dir=$(mktemp -d) original_dir=$PWD
|
||||||
|
|
||||||
|
# Isolate the test repository from the user's git configuration.
|
||||||
|
export GIT_CONFIG_GLOBAL=/dev/null GIT_CONFIG_NOSYSTEM=1
|
||||||
|
export GIT_AUTHOR_NAME=test GIT_AUTHOR_EMAIL=test@example.com
|
||||||
|
export GIT_COMMITTER_NAME=test GIT_COMMITTER_EMAIL=test@example.com
|
||||||
|
|
||||||
|
# check_changelog <description> <until> <since> <patterns...>
|
||||||
|
# Each pattern must match a line of the output; a leading ! means no line may match it.
|
||||||
|
check_changelog() {
|
||||||
|
local description=$1 until=$2 since=$3 pattern
|
||||||
|
shift 3
|
||||||
|
local -a lines
|
||||||
|
lines=("${(@f)$(zsh -f "$changelog" "$until" "$since" --raw)}")
|
||||||
|
for pattern; do
|
||||||
|
if [[ $pattern = !* ]]; then
|
||||||
|
(( ! ${lines[(I)${~pattern#!}]} )) && continue
|
||||||
|
else
|
||||||
|
(( ${lines[(I)${~pattern}]} )) && continue
|
||||||
|
fi
|
||||||
|
print -u2 -r -- "FAIL: $description (pattern: $pattern)"
|
||||||
|
print -u2 -rl -- $lines
|
||||||
|
return 1
|
||||||
|
done
|
||||||
|
print -r -- "PASS: $description"
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
builtin cd "$test_dir"
|
||||||
|
command git init -q
|
||||||
|
command git commit -q --allow-empty -m 'chore: initial commit'
|
||||||
|
print demo > demo && command git add demo
|
||||||
|
command git commit -q -m 'feat(demo): add a demo feature'
|
||||||
|
print core > core && command git add core
|
||||||
|
command git commit -q -m 'fix(core): fix an unrelated bug'
|
||||||
|
command git revert --no-edit HEAD~1 >/dev/null
|
||||||
|
|
||||||
|
check_changelog 'hide a reverted commit and its revert' HEAD HEAD~3 \
|
||||||
|
'*Fix an unrelated bug' '!*Add a demo feature' '!*Revert *'
|
||||||
|
|
||||||
|
check_changelog 'keep a revert whose reverted commit is not in the range' HEAD HEAD~2 \
|
||||||
|
'*Fix an unrelated bug' '*Revert "feat\(demo\): add a demo feature"'
|
||||||
|
|
||||||
|
check_changelog 'keep a commit that has not been reverted yet' HEAD~1 HEAD~3 \
|
||||||
|
'*Add a demo feature' '*Fix an unrelated bug'
|
||||||
|
|
||||||
|
print 'All changelog tests passed.'
|
||||||
|
} always {
|
||||||
|
builtin cd "$original_dir"
|
||||||
|
rm -rf -- "$test_dir"
|
||||||
|
}
|
||||||
@@ -311,6 +311,9 @@ if perform_update; then
|
|||||||
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET
|
||||||
printf '\n'
|
printf '\n'
|
||||||
printf "${BLUE}%s${RESET}\n\n" "$message"
|
printf "${BLUE}%s${RESET}\n\n" "$message"
|
||||||
|
printf "${YELLOW}${BOLD}★${RESET} ${BLUE}${BOLD}%s %s${RESET}\n" \
|
||||||
|
"Enjoying Oh My Zsh? Star us on" \
|
||||||
|
"$(fmt_link GitHub https://github.com/ohmyzsh/ohmyzsh)"
|
||||||
printf "${BLUE}${BOLD}%s %s %s %s${RESET}\n" \
|
printf "${BLUE}${BOLD}%s %s %s %s${RESET}\n" \
|
||||||
"Follow along on X" "($(fmt_link @ohmyzsh https://x.com/ohmyzsh))" \
|
"Follow along on X" "($(fmt_link @ohmyzsh https://x.com/ohmyzsh))" \
|
||||||
"or Bluesky" "($(fmt_link @ohmyz.sh https://bsky.app/profile/ohmyz.sh))"
|
"or Bluesky" "($(fmt_link @ohmyz.sh https://bsky.app/profile/ohmyz.sh))"
|
||||||
|
|||||||
Reference in new issue
Block a user