forked from a/repotool
| .. | ||
| conf.d | ||
| functions | ||
| README.md | ||
Fish Repotool Plugin
A Fish shell plugin for the repotool repository management system.
Installation
Using Fisher
fisher install path/to/fish-repotool
Manual Installation
-
Copy the
conf.d/repotool.fishfile to your fish config directory:cp conf.d/repotool.fish ~/.config/fish/conf.d/ -
Copy the
functions/repotool.fishfile to your fish functions directory:cp functions/repotool.fish ~/.config/fish/functions/
Configuration
Set the REPOTOOL_PATH environment variable to specify where your repositories are stored:
set -gx REPOTOOL_PATH "$HOME/my-repos"
If not set, it defaults to $HOME/repo.
Usage
The plugin provides a repo alias that sources the repotool function with the following commands:
repo get <url>- Clone a repository if not foundrepo worktree list- List existing worktreesrepo worktree get <name>- Create or go to a worktreerepo worktree root- Return to the root directoryrepo worktree remove <name>- Remove a worktreerepo open- Open the current repository in web browser
Hooks
The plugin supports hooks that can be placed in $REPOTOOL_PATH/.hooks/:
before_<hook_name>_cd.fish- Executed before changing directoryafter_<hook_name>_cd.fish- Executed after changing directory
Hooks can also have .sh extension or no extension at all.
Requirements
- Fish shell 4.0 or later
jqfor JSON parsing- The repotool binary installed at
$REPOTOOL_PATH/.bin/repotool