mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
Compare commits
6 Commits
a449c0247d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a98a9f7122 | ||
|
|
5f7f419759 | ||
|
|
e9fc134236 | ||
|
|
977c4f93a6 | ||
|
|
ee30bc535a | ||
|
|
ca5c467db1 |
5
.github/workflows/dependencies.yml
vendored
5
.github/workflows/dependencies.yml
vendored
@@ -4,14 +4,13 @@ on:
|
|||||||
schedule:
|
schedule:
|
||||||
- cron: "0 6 * * 0"
|
- cron: "0 6 * * 0"
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check for updates
|
name: Check for updates
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: github.repository == 'ohmyzsh/ohmyzsh'
|
if: github.repository == 'ohmyzsh/ohmyzsh'
|
||||||
|
permissions:
|
||||||
|
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@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||||
|
|||||||
72
.github/workflows/dependencies/updater.py
vendored
72
.github/workflows/dependencies/updater.py
vendored
@@ -219,32 +219,33 @@ class Dependency:
|
|||||||
# Create new branch
|
# Create new branch
|
||||||
branch = Git.checkout_or_create_branch(branch_name)
|
branch = Git.checkout_or_create_branch(branch_name)
|
||||||
|
|
||||||
# Update dependencies.yml file
|
|
||||||
self.__update_yaml(
|
|
||||||
f"tag:{new_version}" if is_tag else status["version"]
|
|
||||||
)
|
|
||||||
|
|
||||||
# Update dependency files
|
# Update dependency files
|
||||||
self.__apply_upstream_changes()
|
self.__apply_upstream_changes()
|
||||||
|
|
||||||
# Add all changes and commit
|
if not Git.repo_is_clean():
|
||||||
has_new_commit = Git.add_and_commit(self.name, new_version)
|
# Update dependencies.yml file
|
||||||
|
self.__update_yaml(
|
||||||
if has_new_commit:
|
f"tag:{new_version}" if is_tag else status["version"]
|
||||||
# Push changes to remote
|
|
||||||
Git.push(branch)
|
|
||||||
|
|
||||||
# Create GitHub PR
|
|
||||||
GitHub.create_pr(
|
|
||||||
branch,
|
|
||||||
f"feat({self.name}): update to version {new_version}",
|
|
||||||
f"""## Description
|
|
||||||
|
|
||||||
Update for **{self.desc}**: update to version [{new_version}]({status['head_url']}).
|
|
||||||
Check out the [list of changes]({status['compare_url']}).
|
|
||||||
""",
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Add all changes and commit
|
||||||
|
has_new_commit = Git.add_and_commit(self.name, new_version)
|
||||||
|
|
||||||
|
if has_new_commit:
|
||||||
|
# Push changes to remote
|
||||||
|
Git.push(branch)
|
||||||
|
|
||||||
|
# Create GitHub PR
|
||||||
|
GitHub.create_pr(
|
||||||
|
branch,
|
||||||
|
f"chore({self.name}): update to version {new_version}",
|
||||||
|
f"""## Description
|
||||||
|
|
||||||
|
Update for **{self.desc}**: update to version [{new_version}]({status["head_url"]}).
|
||||||
|
Check out the [list of changes]({status["compare_url"]}).
|
||||||
|
""",
|
||||||
|
)
|
||||||
|
|
||||||
# Clean up repository
|
# Clean up repository
|
||||||
Git.clean_repo()
|
Git.clean_repo()
|
||||||
except (CommandRunner.Exception, shutil.Error) as e:
|
except (CommandRunner.Exception, shutil.Error) as e:
|
||||||
@@ -275,8 +276,8 @@ Check out the [list of changes]({status['compare_url']}).
|
|||||||
|
|
||||||
There is a new version of `{self.name}` {self.kind} available.
|
There is a new version of `{self.name}` {self.kind} available.
|
||||||
|
|
||||||
New version: [{new_version}]({status['head_url']})
|
New version: [{new_version}]({status["head_url"]})
|
||||||
Check out the [list of changes]({status['compare_url']}).
|
Check out the [list of changes]({status["compare_url"]}).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
print("Creating GitHub issue", file=sys.stderr)
|
print("Creating GitHub issue", file=sys.stderr)
|
||||||
@@ -377,21 +378,28 @@ class Git:
|
|||||||
)
|
)
|
||||||
return branch_name
|
return branch_name
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def repo_is_clean() -> bool:
|
||||||
|
"""
|
||||||
|
Returns `True` if the repo is clean.
|
||||||
|
Returns `False` if the repo is dirty.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
CommandRunner.run_or_fail(
|
||||||
|
["git", "diff", "--exit-code"], stage="CheckRepoClean"
|
||||||
|
)
|
||||||
|
return True
|
||||||
|
except CommandRunner.Exception:
|
||||||
|
return False
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_and_commit(scope: str, version: str) -> bool:
|
def add_and_commit(scope: str, version: str) -> bool:
|
||||||
"""
|
"""
|
||||||
Returns `True` if there were changes and were indeed commited.
|
Returns `True` if there were changes and were indeed commited.
|
||||||
Returns `False` if the repo was clean and no changes were commited.
|
Returns `False` if the repo was clean and no changes were commited.
|
||||||
"""
|
"""
|
||||||
# check if repo is clean (clean => no error, no commit)
|
if Git.repo_is_clean():
|
||||||
try:
|
|
||||||
CommandRunner.run_or_fail(
|
|
||||||
["git", "diff", "--exit-code"], stage="CheckRepoClean"
|
|
||||||
)
|
|
||||||
return False
|
return False
|
||||||
except CommandRunner.Exception:
|
|
||||||
# if it's other kind of error just throw!
|
|
||||||
pass
|
|
||||||
|
|
||||||
user_name = os.environ.get("GIT_APP_NAME")
|
user_name = os.environ.get("GIT_APP_NAME")
|
||||||
user_email = os.environ.get("GIT_APP_EMAIL")
|
user_email = os.environ.get("GIT_APP_EMAIL")
|
||||||
@@ -415,7 +423,7 @@ class Git:
|
|||||||
f"user.email={user_email}",
|
f"user.email={user_email}",
|
||||||
"commit",
|
"commit",
|
||||||
"-m",
|
"-m",
|
||||||
f"feat({scope}): update to {version}",
|
f"chore({scope}): update to {version}",
|
||||||
],
|
],
|
||||||
stage="CreateCommit",
|
stage="CreateCommit",
|
||||||
env=clean_env,
|
env=clean_env,
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
# Fig plugin
|
|
||||||
|
|
||||||
This plugin sets up completion for [Fig](https://fig.io/).
|
|
||||||
|
|
||||||
To use it, add `fig` to the plugins array in your zshrc file:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
plugins=(... fig)
|
|
||||||
```
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
if ! (( $+commands[fig] )); then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If the completion file doesn't exist yet, we need to autoload it and
|
|
||||||
# bind it to `fig`. Otherwise, compinit will have already done that
|
|
||||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_fig" ]]; then
|
|
||||||
autoload -Uz _fig
|
|
||||||
typeset -g -A _comps
|
|
||||||
_comps[fig]=_fig
|
|
||||||
fi
|
|
||||||
|
|
||||||
fig completion zsh >| "$ZSH_CACHE_DIR/completions/_fig" &|
|
|
||||||
@@ -12,6 +12,16 @@ plugins=(... jj)
|
|||||||
|
|
||||||
| Alias | Command |
|
| Alias | Command |
|
||||||
| ------ | ----------------------------- |
|
| ------ | ----------------------------- |
|
||||||
|
| jjb | `jj bookmark` |
|
||||||
|
| jjbc | `jj bookmark create` |
|
||||||
|
| jjbd | `jj bookmark delete` |
|
||||||
|
| jjbf | `jj bookmark forget` |
|
||||||
|
| jjbl | `jj bookmark list` |
|
||||||
|
| jjbm | `jj bookmark move` |
|
||||||
|
| jjbr | `jj bookmark rename` |
|
||||||
|
| jjbs | `jj bookmark set` |
|
||||||
|
| jjbt | `jj bookmark track` |
|
||||||
|
| jjbu | `jj bookmark untrack` |
|
||||||
| jjc | `jj commit` |
|
| jjc | `jj commit` |
|
||||||
| jjcmsg | `jj commit --message` |
|
| jjcmsg | `jj commit --message` |
|
||||||
| jjd | `jj diff` |
|
| jjd | `jj diff` |
|
||||||
@@ -22,14 +32,20 @@ plugins=(... jj)
|
|||||||
| jjgf | `jj git fetch` |
|
| jjgf | `jj git fetch` |
|
||||||
| jjgfa | `jj git fetch --all-remotes` |
|
| jjgfa | `jj git fetch --all-remotes` |
|
||||||
| jjgp | `jj git push` |
|
| jjgp | `jj git push` |
|
||||||
|
| jjgpa | `jj git push --all` |
|
||||||
|
| jjgpd | `jj git push --deleted` |
|
||||||
|
| jjgpt | `jj git push --tracked` |
|
||||||
| jjl | `jj log` |
|
| jjl | `jj log` |
|
||||||
| jjla | `jj log -r "all()"` |
|
| jjla | `jj log -r "all()"` |
|
||||||
| jjn | `jj new` |
|
| jjn | `jj new` |
|
||||||
|
| jjnt | `jj new "trunk()"` |
|
||||||
| jjrb | `jj rebase` |
|
| jjrb | `jj rebase` |
|
||||||
|
| jjrbm | `jj rebase -d "trunk()"` |
|
||||||
| jjrs | `jj restore` |
|
| jjrs | `jj restore` |
|
||||||
| jjrt | `cd "$(jj root \|\| echo .)"` |
|
| jjrt | `cd "$(jj root \|\| echo .)"` |
|
||||||
| jjsp | `jj split` |
|
| jjsp | `jj split` |
|
||||||
| jjsq | `jj squash` |
|
| jjsq | `jj squash` |
|
||||||
|
| jjst | `jj status` |
|
||||||
|
|
||||||
## Prompt usage
|
## Prompt usage
|
||||||
|
|
||||||
@@ -88,3 +104,4 @@ that.
|
|||||||
## Contributors
|
## Contributors
|
||||||
|
|
||||||
- [nasso](https://github.com/nasso) - Plugin Author
|
- [nasso](https://github.com/nasso) - Plugin Author
|
||||||
|
- [imp](https://github.com/imp) - Occasional Alias Contributor
|
||||||
|
|||||||
@@ -34,6 +34,16 @@ function jj_prompt_template() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Aliases (sorted alphabetically)
|
# Aliases (sorted alphabetically)
|
||||||
|
alias jjb='jj bookmark'
|
||||||
|
alias jjbc='jj bookmark create'
|
||||||
|
alias jjbd='jj bookmark delete'
|
||||||
|
alias jjbf='jj bookmark forget'
|
||||||
|
alias jjbl='jj bookmark list'
|
||||||
|
alias jjbm='jj bookmark move'
|
||||||
|
alias jjbr='jj bookmark rename'
|
||||||
|
alias jjbs='jj bookmark set'
|
||||||
|
alias jjbt='jj bookmark track'
|
||||||
|
alias jjbu='jj bookmark untrack'
|
||||||
alias jjc='jj commit'
|
alias jjc='jj commit'
|
||||||
alias jjcmsg='jj commit --message'
|
alias jjcmsg='jj commit --message'
|
||||||
alias jjd='jj diff'
|
alias jjd='jj diff'
|
||||||
@@ -44,11 +54,17 @@ alias jjgcl='jj git clone'
|
|||||||
alias jjgf='jj git fetch'
|
alias jjgf='jj git fetch'
|
||||||
alias jjgfa='jj git fetch --all-remotes'
|
alias jjgfa='jj git fetch --all-remotes'
|
||||||
alias jjgp='jj git push'
|
alias jjgp='jj git push'
|
||||||
|
alias jjgpa='jj git push --all'
|
||||||
|
alias jjgpd='jj git push --deleted'
|
||||||
|
alias jjgpt='jj git push --tracked'
|
||||||
alias jjl='jj log'
|
alias jjl='jj log'
|
||||||
alias jjla='jj log -r "all()"'
|
alias jjla='jj log -r "all()"'
|
||||||
alias jjn='jj new'
|
alias jjn='jj new'
|
||||||
|
alias jjnt='jj new "trunk()"'
|
||||||
alias jjrb='jj rebase'
|
alias jjrb='jj rebase'
|
||||||
|
alias jjrbm='jj rebase -d "trunk()"'
|
||||||
alias jjrs='jj restore'
|
alias jjrs='jj restore'
|
||||||
alias jjrt='cd "$(jj root || echo .)"'
|
alias jjrt='cd "$(jj root || echo .)"'
|
||||||
alias jjsp='jj split'
|
alias jjsp='jj split'
|
||||||
alias jjsq='jj squash'
|
alias jjsq='jj squash'
|
||||||
|
alias jjst='jj status'
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# rbfu plugin
|
|
||||||
|
|
||||||
This plugin starts [rbfu](https://github.com/hmans/rbfu), a minimal Ruby version
|
|
||||||
manager, and adds some useful functions.
|
|
||||||
|
|
||||||
To use it, add `rbfu` to the plugins array in your zshrc file:
|
|
||||||
|
|
||||||
```zsh
|
|
||||||
plugins=(... rbfu)
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note: `rbfu` is deprecated and should no longer be used.**
|
|
||||||
|
|
||||||
## Functions
|
|
||||||
|
|
||||||
- `rbfu-rubies`: lists all installed rubies available to rbfu.
|
|
||||||
|
|
||||||
- `rvm_prompt_info`: shows the Ruby version being used with rbfu.
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
# Enables rbfu with --auto option, if available.
|
|
||||||
#
|
|
||||||
# Also provides a command to list all installed/available
|
|
||||||
# rubies. To ensure compatibility with themes, creates the
|
|
||||||
# rvm_prompt_info function to return the $RBFU_RUBY_VERSION
|
|
||||||
# version.
|
|
||||||
|
|
||||||
command -v rbfu &>/dev/null || return
|
|
||||||
|
|
||||||
eval "$(rbfu --init --auto)"
|
|
||||||
|
|
||||||
# Internal: Print ruby version details, if it's currently active, etc.
|
|
||||||
function _rbfu_rubies_print() {
|
|
||||||
# 1: path to ruby file
|
|
||||||
# 2: active ruby
|
|
||||||
local rb rb_out
|
|
||||||
rb="${$1:t}"
|
|
||||||
rb_out="$rb"
|
|
||||||
|
|
||||||
# If the ruby is a symlink, add @ to the name.
|
|
||||||
if [[ -h "$1" ]]; then
|
|
||||||
rb_out="${rb_out}${fg[green]}@${reset_color}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# If the ruby is active, add * to the name and show it in red.
|
|
||||||
if [[ "$rb" = "$2" ]]; then
|
|
||||||
rb_out="${fg[red]}${rb_out} ${fg[red]}*${reset_color}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $rb_out
|
|
||||||
}
|
|
||||||
|
|
||||||
# Public: Provide a list with all available rubies, this basically depends
|
|
||||||
# on ~/.rfbu/rubies. Highlights the currently active ruby version and aliases.
|
|
||||||
function rbfu-rubies() {
|
|
||||||
local rbfu_dir active_rb
|
|
||||||
rbfu_dir="${RBFU_RUBIES:-${HOME}/.rbfu/rubies}"
|
|
||||||
active_rb="${RBFU_RUBY_VERSION:-system}"
|
|
||||||
|
|
||||||
_rbfu_rubies_print "${rbfu_dir}/system" "$active_rb"
|
|
||||||
for rb in ${rbfu_dir}/*(N); do
|
|
||||||
_rbfu_rubies_print "$rb" "$active_rb"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# Public: Create rvm_prompt_info command for themes compatibility, unless
|
|
||||||
# it has already been defined.
|
|
||||||
(( ${+functions[rvm_prompt_info]} )) || \
|
|
||||||
function rvm_prompt_info() { echo "${${RBFU_RUBY_VERSION:=system}:gs/%/%%}" }
|
|
||||||
@@ -19,6 +19,7 @@ plugins=(... uv)
|
|||||||
| uvlu | `uv lock --upgrade` | Lock the dependencies to the newest compatible versions |
|
| uvlu | `uv lock --upgrade` | Lock the dependencies to the newest compatible versions |
|
||||||
| uvp | `uv pip` | Manage pip packages |
|
| uvp | `uv pip` | Manage pip packages |
|
||||||
| uvpy | `uv python` | Manage Python installs |
|
| uvpy | `uv python` | Manage Python installs |
|
||||||
|
| uvpp | `uv python pin` | Pin the current project to use a specific Python version |
|
||||||
| uvr | `uv run` | Run commands within the project's environment |
|
| uvr | `uv run` | Run commands within the project's environment |
|
||||||
| uvrm | `uv remove` | Remove packages from the project |
|
| uvrm | `uv remove` | Remove packages from the project |
|
||||||
| uvs | `uv sync` | Sync the environment with the lock file |
|
| uvs | `uv sync` | Sync the environment with the lock file |
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ alias uvlr='uv lock --refresh'
|
|||||||
alias uvlu='uv lock --upgrade'
|
alias uvlu='uv lock --upgrade'
|
||||||
alias uvp='uv pip'
|
alias uvp='uv pip'
|
||||||
alias uvpy='uv python'
|
alias uvpy='uv python'
|
||||||
|
alias uvpp='uv python pin'
|
||||||
alias uvr='uv run'
|
alias uvr='uv run'
|
||||||
alias uvrm='uv remove'
|
alias uvrm='uv remove'
|
||||||
alias uvs='uv sync'
|
alias uvs='uv sync'
|
||||||
|
|||||||
Reference in New Issue
Block a user