1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-11 15:23:41 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Milos Djurica
071bfee023
Merge 76483193b4 into 92aed2e936 2025-12-10 14:09:15 +04:00
Tanzim Hossain Romel
92aed2e936
feat(extract): add unar as fallback for RAR extraction (#13472)
Add unar as a fallback when unrar is not available for extracting
RAR files. This addresses the issue where unrar has been removed
from Homebrew due to licensing issues.

The extraction now:
- Prefers unrar if available (backward compatible)
- Falls back to unar if unrar is not found
- Shows helpful error message if neither tool is installed
2025-12-09 20:14:31 +01:00
Milos Djurica
76483193b4 feature: add foundry's forge plugin 2025-11-03 12:43:03 +01:00
3 changed files with 79 additions and 1 deletions

View File

@ -77,7 +77,15 @@ EOF
(*.lzma) unlzma "$full_path" ;;
(*.z) uncompress "$full_path" ;;
(*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx|*.pk3|*.pk4) unzip "$full_path" ;;
(*.rar) unrar x -ad "$full_path" ;;
(*.rar)
if (( $+commands[unrar] )); then
unrar x -ad "$full_path"
elif (( $+commands[unar] )); then
unar -o . "$full_path"
else
echo "extract: cannot extract RAR files: install unrar or unar" >&2
success=1
fi ;;
(*.rpm)
rpm2cpio "$full_path" | cpio --quiet -id ;;
(*.7z | *.7z.[0-9]* | *.pk7) 7za x "$full_path" ;;

36
plugins/forge/README.md Normal file
View File

@ -0,0 +1,36 @@
## Forge plugin
The Forge plugin provides completion and useful aliases for
[Foundry Forge](https://getfoundry.sh/forge/overview), a command-line tool that tests, builds, and deploys
smart contracts.
To use it, add `forge` to the plugins array of your zshrc file:
```zsh
plugins=(... forge)
```
## Aliases
| Alias | Command | Description |
| :-------- | :--------------- | :----------------------- |
| `finit` | `forge init` | Initialize a new project |
| `fb` | `forge build` | Build the project |
| `fcmp` | `forge compile` | Compile contracts |
| `ft` | `forge test` | Run tests |
| `fdoc` | `forge doc` | Generate documentation |
| `ffmt` | `forge fmt` | Format code |
| `fl` | `forge lint` | Lint code |
| `fsnap` | `forge snapshot` | Create a snapshot |
| `fcov` | `forge coverage` | Generate coverage report |
| `ftree` | `forge tree` | Show dependency tree |
| `fcl` | `forge clean` | Clean build artifacts |
| `fgeiger` | `forge geiger` | Run geiger (security) |
| `fcfg` | `forge config` | Show configuration |
| `fupd` | `forge update` | Update dependencies |
| `fbind` | `forge bind` | Generate bindings |
## Requirements
This plugin requires [Foundry](https://book.getfoundry.sh/getting-started/installation) to be installed and
the `forge` command to be available in your PATH.

View File

@ -0,0 +1,34 @@
# Foundry Forge plugin for oh-my-zsh
# Aliases for common Foundry Forge commands
alias finit='forge init'
alias fb='forge build'
alias fcmp='forge compile'
alias ft='forge test'
alias fdoc='forge doc'
alias ffmt='forge fmt'
alias fl='forge lint'
alias fsnap='forge snapshot'
alias fcov='forge coverage'
alias ftree='forge tree'
alias fcl='forge clean'
alias fgeiger='forge geiger'
alias fcfg='forge config'
alias fupd='forge update'
alias fbind='forge bind'
# COMPLETION FUNCTION
if (( ! $+commands[forge] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `forge`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_forge" ]]; then
typeset -g -A _comps
autoload -Uz _forge
_comps[forge]=_forge
fi
# Generate completion file in the background
forge completions zsh >| "$ZSH_CACHE_DIR/completions/_forge" &|