2024-10-07 19:38:28 -07:00
|
|
|
# repo-manager
|
|
|
|
|
|
|
|
## installation
|
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
### ZSH
|
|
|
|
|
2024-10-07 19:38:28 -07:00
|
|
|
- Sheldon
|
|
|
|
|
|
|
|
```
|
|
|
|
sheldon add repo-manager --github abs3ntdev/repo-manager
|
|
|
|
```
|
|
|
|
|
|
|
|
- zinit
|
|
|
|
|
|
|
|
```
|
|
|
|
zinit light abs3ntdev/repo-manager
|
|
|
|
```
|
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
### Fish
|
|
|
|
|
|
|
|
- Fisher
|
|
|
|
|
|
|
|
```
|
|
|
|
fisher install abs3ntdev/repo-manager
|
|
|
|
```
|
|
|
|
|
|
|
|
- Oh My Fish
|
|
|
|
|
|
|
|
```
|
|
|
|
omf install abs3ntdev/repo-manager
|
|
|
|
```
|
|
|
|
|
2024-10-07 19:38:28 -07:00
|
|
|
## usage
|
|
|
|
|
|
|
|
```
|
|
|
|
Usage: repo <command> <repository>
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
get Clone a repository to the repos directory
|
|
|
|
open Open the current repository in the browser
|
|
|
|
aur Clone an AUR repository
|
|
|
|
list List all repositories
|
|
|
|
go|goto Navigate to a repository
|
|
|
|
new|create Create a new repository
|
|
|
|
help Show this help message
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
repo get github.com/user/repo
|
|
|
|
repo open
|
|
|
|
```
|
|
|
|
|
|
|
|
## configuration
|
|
|
|
|
|
|
|
### hooks
|
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
#### ZSH
|
2024-10-07 19:38:28 -07:00
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
Hooks are configured by overriding the functions provided in the plugin in hooks.zsh
|
|
|
|
The default hooks are:
|
|
|
|
|
|
|
|
```zsh
|
2024-10-07 19:38:28 -07:00
|
|
|
post_repo_clone() {
|
|
|
|
cd "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
post_repo_goto() {
|
|
|
|
cd "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
post_repo_new() {
|
|
|
|
cd "$1"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
You can override these in your .zshrc or in a file sourced by your .zshrc to do whatever you want. Example:
|
2024-10-07 19:38:28 -07:00
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
```zsh
|
2024-10-07 19:38:28 -07:00
|
|
|
post_repo_clone() {
|
|
|
|
code "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
post_repo_goto() {
|
|
|
|
nvim "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
post_repo_new() {
|
|
|
|
some_script "$1"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
#### Fish
|
|
|
|
|
|
|
|
Hooks are configured by overriding the functions provided in the plugin in hooks.fish
|
|
|
|
The default hooks are:
|
2024-10-07 19:38:28 -07:00
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
```fish
|
|
|
|
function post_repo_clone
|
|
|
|
cd "$argv[1]"
|
|
|
|
end
|
2024-10-07 19:38:28 -07:00
|
|
|
|
2025-03-03 18:04:52 -08:00
|
|
|
function post_repo_goto
|
|
|
|
cd "$argv[1]"
|
|
|
|
end
|
|
|
|
|
|
|
|
function post_repo_new
|
|
|
|
cd "$argv[1]"
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
You can override these in your config.fish or in a file sourced by your config.fish to do whatever you want. Example:
|
|
|
|
|
|
|
|
```fish
|
|
|
|
function post_repo_clone
|
|
|
|
code "$argv[1]"
|
|
|
|
end
|
|
|
|
|
|
|
|
function post_repo_goto
|
|
|
|
nvim "$argv[1]"
|
|
|
|
end
|
|
|
|
|
|
|
|
function post_repo_new
|
|
|
|
some_script "$argv[1]"
|
|
|
|
end
|
2024-10-07 19:38:28 -07:00
|
|
|
```
|
2025-03-03 18:04:52 -08:00
|
|
|
|
|
|
|
### base directory
|
|
|
|
|
|
|
|
#### ZSH
|
|
|
|
|
|
|
|
The base directory is set via ENV. The default is $HOME/repos. You can change this by adding the following to your .zshrc:
|
|
|
|
|
|
|
|
```zsh
|
2024-10-07 19:38:28 -07:00
|
|
|
export REPO_BASE_DIR="whatever/you/want"
|
|
|
|
```
|
2025-03-03 18:04:52 -08:00
|
|
|
|
|
|
|
#### Fish
|
|
|
|
|
|
|
|
The base directory is set via ENV. The default is $HOME/repos. You can change this by adding the following to your config.fish:
|
|
|
|
|
|
|
|
```fish
|
|
|
|
set -g REPO_BASE_DIR "whatever/you/want"
|
|
|
|
```
|