Compare commits
	
		
			24 Commits
		
	
	
		
			9f66001a66
			...
			avoid-proj
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2f0e1b0d46 | |||
| 30d86d72ed | |||
| 70027a9880 | |||
| 11a2ca434c | |||
| b9d7d5a4f2 | |||
| 96378d047e | |||
| 888ee5ea4a | |||
| 5f9cc58ef7 | |||
| c78c41f567 | |||
| 9dd38317b8 | |||
| ea10b3c7dd | |||
| 4fca4a5e3e | |||
| 06511f5690 | |||
| f862973c44 | |||
| 19c9fa0f76 | |||
| 03fcbe41ae | |||
| a54f0629be | |||
| f71f8d1ee0 | |||
| 8764edad99 | |||
| ea7367ec08 | |||
| abdfea8153 | |||
| f25b3e0123 | |||
| d6b93a5db7 | |||
| 0968b383ac | 
							
								
								
									
										76
									
								
								.gitea/workflows/ci.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								.gitea/workflows/ci.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,76 @@
 | 
				
			|||||||
 | 
					name: Build and Publish
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  push:
 | 
				
			||||||
 | 
					    tags: ["v*"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					env:
 | 
				
			||||||
 | 
					  PACKAGE_NAME: git-project-manager
 | 
				
			||||||
 | 
					  BINARY_PATH: bin
 | 
				
			||||||
 | 
					  BINARY_NAME: git-project-manager
 | 
				
			||||||
 | 
					  GO_MOD_PATH: gitea.libretechconsulting.com/rmcguire/git-project-manager
 | 
				
			||||||
 | 
					  GO_GIT_HOST: gitea.libretechconsulting.com
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  release:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - name: Checkout Code
 | 
				
			||||||
 | 
					        uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Set up Go Environment
 | 
				
			||||||
 | 
					        uses: actions/setup-go@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          go-version: '1.23'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Build Binary
 | 
				
			||||||
 | 
					        run: make all
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Upload Binary to Generic Registry
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          API_TOKEN: ${{ secrets.API_TOKEN }}
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          echo "Pushing ./$BINARY_PATH/$BINARY_NAME to ${GITHUB_SERVER_URL} packages for ${GITHUB_REPOSITORY_OWNER} as ${PACKAGE_NAME}@${{ github.ref_name }}"
 | 
				
			||||||
 | 
					          if [ -f ./${BINARY_PATH}/${BINARY_NAME} ]; then
 | 
				
			||||||
 | 
					            curl -X PUT \
 | 
				
			||||||
 | 
					              -H "Authorization: token ${API_TOKEN}" \
 | 
				
			||||||
 | 
					              --upload-file ./${BINARY_PATH}/${BINARY_NAME} \
 | 
				
			||||||
 | 
					              "${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/generic/${PACKAGE_NAME}/${{ github.ref_name }}/${BINARY_NAME}"
 | 
				
			||||||
 | 
					          else
 | 
				
			||||||
 | 
					            echo "Error: Binary ./${BINARY_PATH}/${BINARY_NAME} not found."
 | 
				
			||||||
 | 
					            exit 1
 | 
				
			||||||
 | 
					          fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Generate and Upload Package to Go Registry
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          GOPRIVATE: gitea.libretechconsulting.com/*
 | 
				
			||||||
 | 
					          API_TOKEN: ${{ secrets.API_TOKEN }} # Replace with a Gitea token stored in repository secrets
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          # Set up netrc for Gitea
 | 
				
			||||||
 | 
					          echo "machine ${GO_GIT_HOST} login ${GITHUB_REPOSITORY_OWNER} password ${API_TOKEN}" > ~/.netrc
 | 
				
			||||||
 | 
					          chmod 0600 ~/.netrc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          # Package and get mod info
 | 
				
			||||||
 | 
					          go mod download -x --json ${GO_MOD_PATH}@${{ github.ref_name }} | tee package.json
 | 
				
			||||||
 | 
					          if [[ $? -ne 0 ]]; then
 | 
				
			||||||
 | 
					            echo "Failed to generage go package archive for ${GO_MOD_PATH}@${{ github.ref_name }}"
 | 
				
			||||||
 | 
					            exit 1
 | 
				
			||||||
 | 
					          fi
 | 
				
			||||||
 | 
					          ZIPFILE=$( jq .Zip < package.json | tr -d '"' )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					          # Upload to Gitea go registry
 | 
				
			||||||
 | 
					          echo "Uploading go package ${ZIPFILE}"
 | 
				
			||||||
 | 
					          curl -X PUT \
 | 
				
			||||||
 | 
					            -H "Authorization: token ${API_TOKEN}" \
 | 
				
			||||||
 | 
					            --upload-file ${ZIPFILE} \
 | 
				
			||||||
 | 
					            "${GITHUB_SERVER_URL}/api/packages/${GITHUB_REPOSITORY_OWNER}/go/upload"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Run Go List
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          TAG_NAME: ${{ github.ref_name }} # Use the pushed tag name
 | 
				
			||||||
 | 
					        run: |
 | 
				
			||||||
 | 
					          if [[ "$TAG_NAME" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
 | 
				
			||||||
 | 
					            GOPROXY=proxy.golang.org go list -m gitea.libretechconsulting.com/${GITHUB_REPOSITORY}@$TAG_NAME
 | 
				
			||||||
 | 
					          else
 | 
				
			||||||
 | 
					            echo "Error: Invalid tag format '$TAG_NAME'. Expected 'vX.X.X'."
 | 
				
			||||||
 | 
					            exit 1
 | 
				
			||||||
 | 
					          fi
 | 
				
			||||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -1 +1,2 @@
 | 
				
			|||||||
gitlab-project-manager
 | 
					gitlab-project-manager
 | 
				
			||||||
 | 
					bin/*
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										38
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					{
 | 
				
			||||||
 | 
					    "$schema": "https://raw.githubusercontent.com/mfussenegger/dapconfig-schema/master/dapconfig-schema.json",
 | 
				
			||||||
 | 
					    "version": "0.2.0",
 | 
				
			||||||
 | 
					    "configurations": [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "Load Gitea",
 | 
				
			||||||
 | 
					            "type": "delve",
 | 
				
			||||||
 | 
					            "request": "launch",
 | 
				
			||||||
 | 
					            "program": "${workspaceFolder}",
 | 
				
			||||||
 | 
					            "args": [
 | 
				
			||||||
 | 
					                "cache",
 | 
				
			||||||
 | 
					                "load",
 | 
				
			||||||
 | 
					                "--remote",
 | 
				
			||||||
 | 
					                "https://gitea.libretechconsulting.com"
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "List Aliases",
 | 
				
			||||||
 | 
					            "type": "delve",
 | 
				
			||||||
 | 
					            "request": "launch",
 | 
				
			||||||
 | 
					            "program": "${workspaceFolder}",
 | 
				
			||||||
 | 
					            "args": [
 | 
				
			||||||
 | 
					                "alias",
 | 
				
			||||||
 | 
					                "ls"
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "Generate Docs",
 | 
				
			||||||
 | 
					            "type": "delve",
 | 
				
			||||||
 | 
					            "request": "launch",
 | 
				
			||||||
 | 
					            "program": "${workspaceFolder}",
 | 
				
			||||||
 | 
					            "args": [
 | 
				
			||||||
 | 
					                "docs",
 | 
				
			||||||
 | 
					                "md"
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    ]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										20
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								Makefile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,20 @@
 | 
				
			|||||||
 | 
					CMD_NAME := git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.PHONY: all test build install docs clean
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					all: test build install docs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test:
 | 
				
			||||||
 | 
						go test -v ./...
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					build: test
 | 
				
			||||||
 | 
						go build -o bin/${CMD_NAME}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					install:
 | 
				
			||||||
 | 
						go install -v .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					docs:
 | 
				
			||||||
 | 
						bin/${CMD_NAME} docs md
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					clean:
 | 
				
			||||||
 | 
						rm -rf bin/${CMD_NAME}
 | 
				
			||||||
							
								
								
									
										103
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										103
									
								
								README.md
									
									
									
									
									
								
							@@ -1,14 +1,20 @@
 | 
				
			|||||||
# GitLab Project Manager
 | 
					# Git Project Manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Purpose
 | 
					## Purpose
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The goal of this utility is to provide a fuzzy-find method of locating, cloning,
 | 
					The goal of this utility is to provide a fuzzy-find method of locating, cloning,
 | 
				
			||||||
and using GitLab projects -- along with your preferred aliases, autocompletion,
 | 
					and using Git projects -- along with your preferred aliases, autocompletion,
 | 
				
			||||||
and shortcuts.
 | 
					and shortcuts.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This supports GitHub, GitLab, and Gitea remotes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## Documentation
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[Full documentation is available in docs/](./docs/git-project-manager.md)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Functionality
 | 
					## Functionality
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Fuzzy as F_ck. This program will try like hell to help you find a project,
 | 
					This program will try like hell to help you fuzzily find a project,
 | 
				
			||||||
and once you've found it, will remember your preference along with whatever crazy
 | 
					and once you've found it, will remember your preference along with whatever crazy
 | 
				
			||||||
thing your lizard brain wants to call it.
 | 
					thing your lizard brain wants to call it.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -40,37 +46,98 @@ The basic workflow looks like this:
 | 
				
			|||||||
1. Copy `contrib/gpm_func_omz.zsh` into your `~/.oh-my-zsh/custom/` path, or just source from your bashrc/zshrc
 | 
					1. Copy `contrib/gpm_func_omz.zsh` into your `~/.oh-my-zsh/custom/` path, or just source from your bashrc/zshrc
 | 
				
			||||||
1. Generate config file: `gpm config gen --write`
 | 
					1. Generate config file: `gpm config gen --write`
 | 
				
			||||||
    1. You can run this any time to update settings
 | 
					    1. You can run this any time to update settings
 | 
				
			||||||
    1. It will only add one GitLab, so update the file for multiple
 | 
					    1. It will only add one Git remote, so update the file for multiple
 | 
				
			||||||
1. Run `gpm cache load` (if aliases is in-place, otherwise `gitlab-project-manager cache load`)
 | 
					1. Run `gpm cache load` (if aliases is in-place, otherwise `git-project-manager cache load`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Config Sample
 | 
					### Config Sample
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
gitlabs:
 | 
					remotes:
 | 
				
			||||||
  - Host: https://gitlab.sweetwater.com
 | 
					  - host: https://github.com/rdmcguire # add user for multiple keys
 | 
				
			||||||
    Token: <your token here>
 | 
					    token: <your token here>
 | 
				
			||||||
    Name: Sweetwater GitLab
 | 
					    name: github-rdmcguire
 | 
				
			||||||
 | 
					    type: "github" # github, gitlab, gitea supported
 | 
				
			||||||
 | 
					    cloneProto: ssh
 | 
				
			||||||
logLevel: info
 | 
					logLevel: info
 | 
				
			||||||
cache:
 | 
					cache:
 | 
				
			||||||
  ttl: 168h
 | 
					  ttl: 168h
 | 
				
			||||||
  load:
 | 
					  load:
 | 
				
			||||||
    ownerOnly: false
 | 
					    ownerOnly: false # if true, only owned projects will be indexed
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					## Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Global Flags
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- The `--remote` flag limits all subcommands to one or more specified remotes
 | 
				
			||||||
 | 
					- The `--logLevel [debug|error|info|warn]` flag sets logging, but is permanent in the config file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Basic Usage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Basic usage to prepare your cache, add a project alias (or aliases), and use a project:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					1. `gpm cache load`
 | 
				
			||||||
 | 
					1. `gpm project add`
 | 
				
			||||||
 | 
					  1. select with fuzzy search, add extra aliases if preferred
 | 
				
			||||||
 | 
					1. `gpm project [go|open] <optional-fuzzy-search-term>`
 | 
				
			||||||
 | 
					  1. Open will launch your editor, go will change directories, cloning if necessary
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Cache Management
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```shell
 | 
				
			||||||
 | 
					% git-project-manager cache -h
 | 
				
			||||||
 | 
					Contains sub-commands for managing project cache.
 | 
				
			||||||
 | 
					The project cache keeps this speedy, without smashing against the Git remote's
 | 
				
			||||||
 | 
					API every time a new project is added / searched for
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Usage:
 | 
				
			||||||
 | 
					  git-project-manager cache [command]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Aliases:
 | 
				
			||||||
 | 
					  cache, a, ln
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Available Commands:
 | 
				
			||||||
 | 
					  clear       Clear Git Project Cache
 | 
				
			||||||
 | 
					  dump        Dump Git project cache
 | 
				
			||||||
 | 
					  load        Load Git Project Cache
 | 
				
			||||||
 | 
					  unlock      unlock Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Flags:
 | 
				
			||||||
 | 
					  -h, --help           help for cache
 | 
				
			||||||
 | 
					      --ttl duration   Duration before cache is re-built in go time.Duration format (default 48h0m0s)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Global Flags:
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Use "git-project-manager cache [command] --help" for more information about a command.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- To update your cache, run `gpm cache load`. You can also specify one or more remotes
 | 
				
			||||||
 | 
					  with `--remote [host]` either multiple times or comma delimited. Command completion works.
 | 
				
			||||||
 | 
					- To view basic cache stats, run `gpm cache dump`
 | 
				
			||||||
 | 
					- To dump cache projects and any aliases that are set, run `gpm cache dump -f` optionally filtering with `--remote` flags
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## TODO
 | 
					## TODO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- [ ] Make generic, this is any git remote, not just GitLab
 | 
					- [x] Don't check remote up unless necessary (project list shouldn't require it)
 | 
				
			||||||
    - [x] Add Gitea support
 | 
					- [x] Rename to git-project-manager
 | 
				
			||||||
    - [ ] Add GitHub support
 | 
					- [x] Move module to github.com/rdmcguire
 | 
				
			||||||
    - [x] Remove separate gitlab/gitea logic and keys, stop supporting legacy keys
 | 
					 | 
				
			||||||
    - [x] Rename --gitlab flag to --remote
 | 
					 | 
				
			||||||
- [ ] Option to prune missing after the load is complete
 | 
					 | 
				
			||||||
- [ ] Add flag for clone timeout for large repos
 | 
					- [ ] Add flag for clone timeout for large repos
 | 
				
			||||||
 | 
					- [ ] Add `gpm cache prune` command
 | 
				
			||||||
- [ ] Fix NPE when cache is reset or project for whatever reason leaves an orphaned alias
 | 
					- [ ] Fix NPE when cache is reset or project for whatever reason leaves an orphaned alias
 | 
				
			||||||
- [ ] Add TTL check to cache load, and add -f / --force flag to re-build regardless
 | 
					- [ ] Add TTL check to cache load, and add -f / --force flag to re-build regardless
 | 
				
			||||||
- [ ] Update README for shell completion, aliases, usage
 | 
					- [ ] Update README for shell completion, aliases, usage
 | 
				
			||||||
- [ ] Make a Makefile
 | 
					- [ ] Make a Makefile
 | 
				
			||||||
- [ ] Add git repo status to project go (up-to-date, pending commits, etc..)
 | 
					- [ ] Add git repo status to project go (up-to-date, pending commits, etc..)
 | 
				
			||||||
- [ ] Build pipeline, and link to gitlab registry for a release binary
 | 
					- [ ] Build pipeline, and link to registry for a release binary
 | 
				
			||||||
- [ ] Brew package and GitHub
 | 
					- [ ] Add GitHub remote
 | 
				
			||||||
 | 
					- [ ] Package for homebrew
 | 
				
			||||||
 | 
					- [x] Make generic, this is any git remote, not just GitLab
 | 
				
			||||||
 | 
					    - [x] Add Gitea support
 | 
				
			||||||
 | 
					    - [x] Add GitHub support
 | 
				
			||||||
 | 
					    - [x] Remove separate gitlab/gitea logic and keys, stop supporting legacy keys
 | 
				
			||||||
 | 
					    - [x] Rename --gitlab flag to --remote
 | 
				
			||||||
- [x] Add option to select individual remote for `gpm cache load`
 | 
					- [x] Add option to select individual remote for `gpm cache load`
 | 
				
			||||||
- [x] Use multi-gitlab by default in config init
 | 
					- [x] Use multi-gitlab by default in config init
 | 
				
			||||||
    - [x] Update docs for multi-gitlab
 | 
					    - [x] Update docs for multi-gitlab
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										25
									
								
								cmd/alias.go
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								cmd/alias.go
									
									
									
									
									
								
							@@ -1,25 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var aliasCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:     "alias",
 | 
					 | 
				
			||||||
	Aliases: []string{"aliases", "a"},
 | 
					 | 
				
			||||||
	Short:   "Manage project aliases",
 | 
					 | 
				
			||||||
	Long:    aliasCmdLong,
 | 
					 | 
				
			||||||
	// Just re-use the hooks for project
 | 
					 | 
				
			||||||
	PersistentPreRun:  initProjectCmd,
 | 
					 | 
				
			||||||
	PersistentPostRun: postProjectCmd,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	rootCmd.AddCommand(aliasCmd)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func mustHaveAliases(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	if len(projectCache.Aliases) == 0 {
 | 
					 | 
				
			||||||
		plog.Fatal("No aliases set, nothing to " + cmd.Name())
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										38
									
								
								cmd/alias/alias.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								cmd/alias/alias.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					package alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var AliasCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:     "alias",
 | 
				
			||||||
 | 
						Aliases: []string{"aliases", "a"},
 | 
				
			||||||
 | 
						Short:   "Manage project aliases",
 | 
				
			||||||
 | 
						Long:    util.AliasCmdLong,
 | 
				
			||||||
 | 
						// Just re-use the hooks for project
 | 
				
			||||||
 | 
						PersistentPreRun:  util.InitProjects,
 | 
				
			||||||
 | 
						PersistentPostRun: util.PostProjectCmd,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var utils *util.Utils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func aliasCmdPreRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils = util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						util.InitProjects(cmd, args)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func mustHaveAliases(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils = util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(utils.Cache().Aliases) == 0 {
 | 
				
			||||||
 | 
							utils.Logger().Fatal("No aliases set, nothing to " + cmd.Name())
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						AliasCmd.AddCommand(aliasAddCmd)
 | 
				
			||||||
 | 
						AliasCmd.AddCommand(aliasListCmd)
 | 
				
			||||||
 | 
						AliasCmd.AddCommand(aliasDeleteCmd)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										116
									
								
								cmd/alias/alias_add.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										116
									
								
								cmd/alias/alias_add.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,116 @@
 | 
				
			|||||||
 | 
					package alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var aliasAddCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:     "add",
 | 
				
			||||||
 | 
						Aliases: []string{"set", "a", "s"},
 | 
				
			||||||
 | 
						Short:   "Add a project alias",
 | 
				
			||||||
 | 
						Args:    cobra.ArbitraryArgs,
 | 
				
			||||||
 | 
						Long:    util.AliasAddCmdLong,
 | 
				
			||||||
 | 
						Run:     runAddAliasCmd,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func runAddAliasCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						var project *projects.Project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Check by flag
 | 
				
			||||||
 | 
						if projectID := viper.GetInt(util.ViperAliasAddPID); projectID > 0 {
 | 
				
			||||||
 | 
							utils.Logger().Debug(fmt.Sprintf("Adding for inbound project ID %d", projectID))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							projects := utils.Cache().GetProjectsByID(projectID)
 | 
				
			||||||
 | 
							if len(projects) > 0 {
 | 
				
			||||||
 | 
								project = projects[0]
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if len(projects) > 1 {
 | 
				
			||||||
 | 
								utils.Logger().
 | 
				
			||||||
 | 
									Warn(fmt.Sprintf("found %d remotes with same ID, using first remote", len(projects)))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Check by arg
 | 
				
			||||||
 | 
						if len(args) > 0 {
 | 
				
			||||||
 | 
							project = utils.FzfFindProject(&util.FzfProjectOpts{Ctx: cmd.Context(), Search: utils.SearchStringFromArgs(args)})
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Collect by fzf
 | 
				
			||||||
 | 
						if project == nil {
 | 
				
			||||||
 | 
							var err error
 | 
				
			||||||
 | 
							project, err = utils.FzfProject(&util.FzfProjectOpts{Ctx: cmd.Context()})
 | 
				
			||||||
 | 
							if err != nil || project == nil {
 | 
				
			||||||
 | 
								utils.Logger().Fatal("No project to alias, nothing to do", utils.Logger().Args("error", err))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						AddNewAliases(cmd, project.GetID())
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func AddNewAliases(cmd *cobra.Command, projectID string) {
 | 
				
			||||||
 | 
						u := util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						project := u.Cache().GetProjectByID(projectID)
 | 
				
			||||||
 | 
						if project == nil {
 | 
				
			||||||
 | 
							u.Logger().Error("Failed to find project to alias", u.Logger().Args("projectID", projectID))
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Collect the aliases
 | 
				
			||||||
 | 
						aliases := PromptAliasesForProject(cmd, project)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Add aliases
 | 
				
			||||||
 | 
						for _, a := range aliases {
 | 
				
			||||||
 | 
							a = strings.Trim(a, " '\"%<>|`")
 | 
				
			||||||
 | 
							if a == "" {
 | 
				
			||||||
 | 
								continue
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if err := u.Cache().AddAlias(a, project); err != nil {
 | 
				
			||||||
 | 
								u.Logger().Debug("Skipping alias add", u.Logger().Args(
 | 
				
			||||||
 | 
									"error", err,
 | 
				
			||||||
 | 
									"alias", a,
 | 
				
			||||||
 | 
								))
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								u.Logger().Info("Successfully added alias to project", u.Logger().Args(
 | 
				
			||||||
 | 
									"project", project.String(),
 | 
				
			||||||
 | 
									"alias", a,
 | 
				
			||||||
 | 
								))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func PromptAliasesForProject(cmd *cobra.Command, p *projects.Project) []string {
 | 
				
			||||||
 | 
						u := util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						aliases := u.Cache().GetProjectAliases(p)
 | 
				
			||||||
 | 
						if len(aliases) > 0 {
 | 
				
			||||||
 | 
							u.Logger().Info("Adding aliases to project", u.Logger().Args(
 | 
				
			||||||
 | 
								"project", p.String(),
 | 
				
			||||||
 | 
								"existingAliases", cache.ProjectAliasesString(aliases),
 | 
				
			||||||
 | 
							))
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							pterm.Info.Printfln("Adding aliases to %s", p.Name)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						response, _ := pterm.DefaultInteractiveTextInput.
 | 
				
			||||||
 | 
							WithMultiLine(false).
 | 
				
			||||||
 | 
							WithDefaultValue(p.Path + " ").
 | 
				
			||||||
 | 
							Show("Enter aliases separated by space")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return strings.Split(response, " ")
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						aliasAddCmd.PersistentFlags().Int(util.FlagProjectID, 0, "Specify a project by ID")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						aliasAddCmd.RegisterFlagCompletionFunc(util.FlagProjectID, util.ValidProjectIdFunc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						viper.BindPFlag(util.ViperAliasAddPID, aliasAddCmd.Flag(util.FlagProjectID))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,19 +1,20 @@
 | 
				
			|||||||
package cmd
 | 
					package alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var aliasDeleteCmd = &cobra.Command{
 | 
					var aliasDeleteCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "delete [fuzzy project or alias]",
 | 
						Use:     "delete [fuzzy project or alias]",
 | 
				
			||||||
	Aliases: []string{"rm", "del", "d"},
 | 
						Aliases: []string{"rm", "del", "d"},
 | 
				
			||||||
	Short:   "Delete a project alias",
 | 
						Short:   "Delete a project alias",
 | 
				
			||||||
	Long:    aliasDeleteCmdLong,
 | 
						Long:    util.AliasDeleteCmdLong,
 | 
				
			||||||
	PreRun:  mustHaveAliases,
 | 
						PreRun:  mustHaveAliases,
 | 
				
			||||||
	Run:     runDeleteAliasCmd,
 | 
						Run:     runDeleteAliasCmd,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -22,32 +23,32 @@ func runDeleteAliasCmd(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
	var project *projects.Project
 | 
						var project *projects.Project
 | 
				
			||||||
	var err error
 | 
						var err error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fzfOpts := &fzfProjectOpts{
 | 
						fzfOpts := &util.FzfProjectOpts{
 | 
				
			||||||
		Ctx:           cmd.Context(),
 | 
							Ctx:           cmd.Context(),
 | 
				
			||||||
		MustHaveAlias: true,
 | 
							MustHaveAlias: true,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(args) > 0 {
 | 
						if len(args) > 0 {
 | 
				
			||||||
		fzfOpts.Search = searchStringFromArgs(args)
 | 
							fzfOpts.Search = utils.SearchStringFromArgs(args)
 | 
				
			||||||
		project = fzfFindProject(fzfOpts)
 | 
							project = utils.FzfFindProject(fzfOpts)
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		project, err = fzfProject(fzfOpts)
 | 
							project, err = utils.FzfProject(fzfOpts)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if project == nil || err != nil {
 | 
						if project == nil || err != nil {
 | 
				
			||||||
		plog.Fatal("Failed to find project to delete aliases from", plog.Args(
 | 
							utils.Logger().Fatal("Failed to find project to delete aliases from", utils.Logger().Args(
 | 
				
			||||||
			"error", err,
 | 
								"error", err,
 | 
				
			||||||
		))
 | 
							))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	aliasStrings := projectCache.GetProjectAliasStrings(project)
 | 
						aliasStrings := utils.Cache().GetProjectAliasStrings(project)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	deletionCandidates, err := pterm.DefaultInteractiveMultiselect.
 | 
						deletionCandidates, err := pterm.DefaultInteractiveMultiselect.
 | 
				
			||||||
		WithOptions(aliasStrings).
 | 
							WithOptions(aliasStrings).
 | 
				
			||||||
		Show()
 | 
							Show()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil || len(deletionCandidates) < 1 {
 | 
						if err != nil || len(deletionCandidates) < 1 {
 | 
				
			||||||
		plog.Fatal("Failed to find project to delete aliases from", plog.Args(
 | 
							utils.Logger().Fatal("Failed to find project to delete aliases from", utils.Logger().Args(
 | 
				
			||||||
			"error", err,
 | 
								"error", err,
 | 
				
			||||||
		))
 | 
							))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -61,26 +62,25 @@ func runDeleteAliasCmd(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
			Show()
 | 
								Show()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if !confirm {
 | 
							if !confirm {
 | 
				
			||||||
			plog.Warn("Alias deletion cancelled")
 | 
								utils.Logger().Warn("Alias deletion cancelled")
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		plog.Info("Deleting alias", plog.Args(
 | 
							utils.Logger().Info("Deleting alias", utils.Logger().Args(
 | 
				
			||||||
			"project", project.String(),
 | 
								"project", project.String(),
 | 
				
			||||||
			"alias", a,
 | 
								"alias", a,
 | 
				
			||||||
		))
 | 
							))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		projectCache.DeleteAlias(projectCache.GetAliasByName(a))
 | 
							utils.Cache().DeleteAlias(utils.Cache().GetAliasByName(a))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fmt.Println(projectCache.ProjectString(project))
 | 
						fmt.Println(utils.Cache().ProjectString(project))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	aliasCmd.AddCommand(aliasDeleteCmd)
 | 
					 | 
				
			||||||
	aliasDeleteCmd.PersistentFlags().Int("projectID", 0, "Specify a project by ID")
 | 
						aliasDeleteCmd.PersistentFlags().Int("projectID", 0, "Specify a project by ID")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	aliasDeleteCmd.RegisterFlagCompletionFunc("projectID", validProjectIdFunc)
 | 
						aliasDeleteCmd.RegisterFlagCompletionFunc("projectID", util.ValidProjectIdFunc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	viper.BindPFlag("alias.delete.projectID", aliasDeleteCmd.Flag("projectID"))
 | 
						viper.BindPFlag("alias.delete.projectID", aliasDeleteCmd.Flag("projectID"))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package cmd
 | 
					package alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
@@ -6,6 +6,8 @@ import (
 | 
				
			|||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// listCmd represents the list command
 | 
					// listCmd represents the list command
 | 
				
			||||||
@@ -14,20 +16,24 @@ var aliasListCmd = &cobra.Command{
 | 
				
			|||||||
	Aliases: []string{"dump", "show", "ls", "ll", "l"},
 | 
						Aliases: []string{"dump", "show", "ls", "ll", "l"},
 | 
				
			||||||
	Short:   "List Aliases",
 | 
						Short:   "List Aliases",
 | 
				
			||||||
	PreRun:  mustHaveAliases,
 | 
						PreRun:  mustHaveAliases,
 | 
				
			||||||
	Long:    aliasListCmdLong,
 | 
						Long:    util.AliasListCmdLong,
 | 
				
			||||||
	Run:     runListAliasCmd,
 | 
						Run:     runListAliasCmd,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func runListAliasCmd(cmd *cobra.Command, args []string) {
 | 
					func runListAliasCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
	pterm.DefaultBox.
 | 
						aliases := utils.Cache().AliasesByProjectString(remotes...)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						printer := pterm.DefaultBox.
 | 
				
			||||||
		WithLeftPadding(5).WithRightPadding(5).
 | 
							WithLeftPadding(5).WithRightPadding(5).
 | 
				
			||||||
		WithBoxStyle(&pterm.Style{pterm.FgLightBlue}).
 | 
							WithBoxStyle(&pterm.Style{pterm.FgLightBlue}).
 | 
				
			||||||
		WithTitle(pterm.Bold.Sprint(pterm.LightGreen("Aliases by Project"))).
 | 
							WithTitle(pterm.Bold.Sprint(pterm.LightGreen("Aliases by Project")))
 | 
				
			||||||
		Print("\n" + projectCache.AliasesByProjectString(remotes...))
 | 
					
 | 
				
			||||||
 | 
						if len(aliases) < 1 {
 | 
				
			||||||
 | 
							printer.Print("\n" + "No Aliases Found")
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							printer.Print("\n" + aliases)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fmt.Print("\n\n")
 | 
						fmt.Print("\n\n")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	aliasCmd.AddCommand(aliasListCmd)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										105
									
								
								cmd/alias_add.go
									
									
									
									
									
								
							
							
						
						
									
										105
									
								
								cmd/alias_add.go
									
									
									
									
									
								
							@@ -1,105 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
	"strings"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/cache"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var aliasAddCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:     "add",
 | 
					 | 
				
			||||||
	Aliases: []string{"set", "a", "s"},
 | 
					 | 
				
			||||||
	Short:   "Add a project alias",
 | 
					 | 
				
			||||||
	Args:    cobra.ArbitraryArgs,
 | 
					 | 
				
			||||||
	Long:    aliasAddCmdLong,
 | 
					 | 
				
			||||||
	Run:     runAddAliasCmd,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func runAddAliasCmd(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	var project *projects.Project
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Check by flag
 | 
					 | 
				
			||||||
	if projectID := viper.GetInt("alias.add.projectid"); projectID > 0 {
 | 
					 | 
				
			||||||
		plog.Debug(fmt.Sprintf("Adding for inbound project ID %d", projectID))
 | 
					 | 
				
			||||||
		project = projectCache.GetProjectByID(projectID)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Check by arg
 | 
					 | 
				
			||||||
	if len(args) > 0 {
 | 
					 | 
				
			||||||
		project = fzfFindProject(&fzfProjectOpts{Ctx: cmd.Context(), Search: searchStringFromArgs(args)})
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Collect by fzf
 | 
					 | 
				
			||||||
	if project == nil {
 | 
					 | 
				
			||||||
		var err error
 | 
					 | 
				
			||||||
		project, err = fzfProject(&fzfProjectOpts{Ctx: cmd.Context()})
 | 
					 | 
				
			||||||
		if err != nil || project == nil {
 | 
					 | 
				
			||||||
			plog.Fatal("No project to alias, nothing to do", plog.Args("error", err))
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	addNewAliases(project.ID)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func addNewAliases(projectID int) {
 | 
					 | 
				
			||||||
	project := projectCache.GetProjectByID(projectID)
 | 
					 | 
				
			||||||
	if project == nil {
 | 
					 | 
				
			||||||
		plog.Error("Failed to find project to alias", plog.Args("projectID", projectID))
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Collect the aliases
 | 
					 | 
				
			||||||
	aliases := promptAliasesForProject(project)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Add aliases
 | 
					 | 
				
			||||||
	for _, a := range aliases {
 | 
					 | 
				
			||||||
		a = strings.Trim(a, " '\"%<>|`")
 | 
					 | 
				
			||||||
		if a == "" {
 | 
					 | 
				
			||||||
			continue
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if err := projectCache.AddAlias(a, project.ID, project.Remote); err != nil {
 | 
					 | 
				
			||||||
			plog.Debug("Skipping alias add", plog.Args(
 | 
					 | 
				
			||||||
				"error", err,
 | 
					 | 
				
			||||||
				"alias", a,
 | 
					 | 
				
			||||||
			))
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			plog.Info("Successfully added alias to project", plog.Args(
 | 
					 | 
				
			||||||
				"project", project.String(),
 | 
					 | 
				
			||||||
				"alias", a,
 | 
					 | 
				
			||||||
			))
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func promptAliasesForProject(p *projects.Project) []string {
 | 
					 | 
				
			||||||
	aliases := projectCache.GetProjectAliases(p)
 | 
					 | 
				
			||||||
	if len(aliases) > 0 {
 | 
					 | 
				
			||||||
		plog.Info("Adding aliases to project", plog.Args(
 | 
					 | 
				
			||||||
			"project", p.String(),
 | 
					 | 
				
			||||||
			"existingAliases", cache.ProjectAliasesString(aliases),
 | 
					 | 
				
			||||||
		))
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		pterm.Info.Printfln("Adding aliases to %s", p.Name)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	response, _ := pterm.DefaultInteractiveTextInput.
 | 
					 | 
				
			||||||
		WithMultiLine(false).
 | 
					 | 
				
			||||||
		WithDefaultValue(p.Path + " ").
 | 
					 | 
				
			||||||
		Show("Enter aliases separated by space")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return strings.Split(response, " ")
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	aliasCmd.AddCommand(aliasAddCmd)
 | 
					 | 
				
			||||||
	aliasAddCmd.PersistentFlags().Int("projectID", 0, "Specify a project by ID")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	aliasAddCmd.RegisterFlagCompletionFunc("projectID", validProjectIdFunc)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	viper.BindPFlag("alias.add.projectID", aliasAddCmd.Flag("projectID"))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										37
									
								
								cmd/cache.go
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								cmd/cache.go
									
									
									
									
									
								
							@@ -1,37 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"time"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/cache"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var projectCache *cache.Cache
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var cacheCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:     "cache",
 | 
					 | 
				
			||||||
	Aliases: []string{"a", "ln"},
 | 
					 | 
				
			||||||
	Short:   "Manage GitLab project cache",
 | 
					 | 
				
			||||||
	Long:    cacheCmdLong,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func runCacheCmd(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	initProjectCache(cmd, args)
 | 
					 | 
				
			||||||
	projectCache.LockCache()
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func postCacheCmd(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	postProjectCache(cmd, args)
 | 
					 | 
				
			||||||
	projectCache.UnlockCache()
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	rootCmd.AddCommand(cacheCmd)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	cacheCmd.PersistentFlags().Duration("ttl", 48*time.Hour,
 | 
					 | 
				
			||||||
		"Duration before cache is re-built in go time.Duration format")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	viper.BindPFlags(cacheCmd.Flags())
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										43
									
								
								cmd/cache/cache.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								cmd/cache/cache.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					package cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var CacheCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:     "cache",
 | 
				
			||||||
 | 
						Aliases: []string{"a", "ln"},
 | 
				
			||||||
 | 
						Short:   "Manage Git project cache",
 | 
				
			||||||
 | 
						Long:    util.CacheCmdLong,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var utils *util.Utils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func runCacheCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils = util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						utils.InitProjectCache(cmd, args)
 | 
				
			||||||
 | 
						utils.Cache().LockCache()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func postCacheCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils.PostProjectCache(cmd, args)
 | 
				
			||||||
 | 
						utils.Cache().UnlockCache()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						CacheCmd.PersistentFlags().Duration("ttl", 48*time.Hour,
 | 
				
			||||||
 | 
							"Duration before cache is re-built in go time.Duration format")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						viper.BindPFlags(CacheCmd.Flags())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						CacheCmd.AddCommand(clearCmd)
 | 
				
			||||||
 | 
						CacheCmd.AddCommand(dumpCmd)
 | 
				
			||||||
 | 
						CacheCmd.AddCommand(loadCmd)
 | 
				
			||||||
 | 
						CacheCmd.AddCommand(unlockCmd)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package cmd
 | 
					package cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
@@ -12,7 +12,7 @@ If --clearAliases is provided, will also reset aliases. Use with caution.`
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
var clearCmd = &cobra.Command{
 | 
					var clearCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "clear",
 | 
						Use:     "clear",
 | 
				
			||||||
	Short:   "Clear GitLab Project Cache",
 | 
						Short:   "Clear Git Project Cache",
 | 
				
			||||||
	PreRun:  runCacheCmd,
 | 
						PreRun:  runCacheCmd,
 | 
				
			||||||
	PostRun: postCacheCmd,
 | 
						PostRun: postCacheCmd,
 | 
				
			||||||
	Long:    longDesc,
 | 
						Long:    longDesc,
 | 
				
			||||||
@@ -21,11 +21,10 @@ var clearCmd = &cobra.Command{
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func clearCache(cmd *cobra.Command, args []string) {
 | 
					func clearCache(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	slog.Debug("Preparing to clear local cache")
 | 
						slog.Debug("Preparing to clear local cache")
 | 
				
			||||||
	projectCache.Clear(conf.Cache.Clear.ClearAliases)
 | 
						utils.Cache().Clear(utils.Config().Cache.Clear.ClearAliases)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	cacheCmd.AddCommand(clearCmd)
 | 
					 | 
				
			||||||
	clearCmd.Flags().Bool("clearAliases", false, "Will also clear aliases from the cache, use with caution")
 | 
						clearCmd.Flags().Bool("clearAliases", false, "Will also clear aliases from the cache, use with caution")
 | 
				
			||||||
	viper.BindPFlag("cache.clear.clearAliases", clearCmd.LocalFlags().Lookup("clearAliases"))
 | 
						viper.BindPFlag("cache.clear.clearAliases", clearCmd.LocalFlags().Lookup("clearAliases"))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										15
									
								
								cmd/cache_dump.go → cmd/cache/cache_dump.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								cmd/cache_dump.go → cmd/cache/cache_dump.go
									
									
									
									
										vendored
									
									
								
							@@ -1,15 +1,17 @@
 | 
				
			|||||||
package cmd
 | 
					package cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var dumpCmd = &cobra.Command{
 | 
					var dumpCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "dump",
 | 
						Use:     "dump",
 | 
				
			||||||
	Short:   "Dump GitLab project cache",
 | 
						Short:   "Dump Git project cache",
 | 
				
			||||||
	Long:    `Dumps cache to display`,
 | 
						Long:    `Dumps cache to display`,
 | 
				
			||||||
	PreRun:  runCacheCmd,
 | 
						PreRun:  runCacheCmd,
 | 
				
			||||||
	PostRun: postCacheCmd,
 | 
						PostRun: postCacheCmd,
 | 
				
			||||||
@@ -17,16 +19,15 @@ var dumpCmd = &cobra.Command{
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func runCacheDunpCmd(cmd *cobra.Command, args []string) {
 | 
					func runCacheDunpCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
	if conf.Dump.Full {
 | 
						if utils.Config().Dump.Full {
 | 
				
			||||||
		fmt.Println(projectCache.DumpString(true, searchStringFromArgs(args), remotes...))
 | 
							fmt.Println(utils.Cache().DumpString(true, utils.SearchStringFromArgs(args), remotes...))
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		plog.Info(projectCache.String())
 | 
							utils.Logger().Info(utils.Cache().String())
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	cacheCmd.AddCommand(dumpCmd)
 | 
					 | 
				
			||||||
	dumpCmd.PersistentFlags().BoolP("full", "f", false, "Dumps entire cache")
 | 
						dumpCmd.PersistentFlags().BoolP("full", "f", false, "Dumps entire cache")
 | 
				
			||||||
	viper.BindPFlag("dump.full", dumpCmd.LocalFlags().Lookup("full"))
 | 
						viper.BindPFlag("dump.full", dumpCmd.LocalFlags().Lookup("full"))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										31
									
								
								cmd/cache/cache_load.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								cmd/cache/cache_load.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					package cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var loadCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:   "load",
 | 
				
			||||||
 | 
						Short: "Load Git Project Cache",
 | 
				
			||||||
 | 
						Long: `Used to initialize or update a new Git cache. With thousands
 | 
				
			||||||
 | 
					of projects, it would be too much work to hit the API every time a user
 | 
				
			||||||
 | 
					wants to find a new project.`,
 | 
				
			||||||
 | 
						PreRun:  runCacheCmd,
 | 
				
			||||||
 | 
						PostRun: postCacheCmd,
 | 
				
			||||||
 | 
						Run:     loadCache,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func loadCache(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
 | 
						utils.Cache().Refresh(remotes...)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						loadCmd.PersistentFlags().Bool(util.FlagOwnerOnly, true,
 | 
				
			||||||
 | 
							"Only load projects that you are owner of")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						viper.BindPFlag(util.ViperCacheLoadOwnerOnly, loadCmd.Flag(util.FlagOwnerOnly))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										33
									
								
								cmd/cache/cache_unlock.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								cmd/cache/cache_unlock.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					package cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var unlockCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:   "unlock",
 | 
				
			||||||
 | 
						Short: "unlock Git project cache",
 | 
				
			||||||
 | 
						Long:  `unlocks cache to display`,
 | 
				
			||||||
 | 
						Run: func(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
							utils = util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
							utils.InitProjectCache(cmd, args)
 | 
				
			||||||
 | 
							if viper.GetBool(util.ViperCacheUnlockForce) {
 | 
				
			||||||
 | 
								utils.Cache().UnlockCache()
 | 
				
			||||||
 | 
							} else if yes, _ := pterm.DefaultInteractiveConfirm.
 | 
				
			||||||
 | 
								WithDefaultValue(false).
 | 
				
			||||||
 | 
								Show("Are you sure you want to manually unlock?"); yes {
 | 
				
			||||||
 | 
								utils.Cache().UnlockCache()
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								utils.Logger().Error("You failed to confirm cache unlock")
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						unlockCmd.PersistentFlags().BoolP(util.FlagCacheForce, "f", false, "force unlocks cache (don't ask)")
 | 
				
			||||||
 | 
						viper.BindPFlag(util.ViperCacheUnlockForce, unlockCmd.LocalFlags().Lookup(util.FlagCacheForce))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,31 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var loadCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:   "load",
 | 
					 | 
				
			||||||
	Short: "Load GitLab Project Cache",
 | 
					 | 
				
			||||||
	Long: `Used to initialize or update a new GitLab cache. With thousands
 | 
					 | 
				
			||||||
of projects, it would be too much work to hit the API every time a user
 | 
					 | 
				
			||||||
wants to find a new project.`,
 | 
					 | 
				
			||||||
	PreRun:  runCacheCmd,
 | 
					 | 
				
			||||||
	PostRun: postCacheCmd,
 | 
					 | 
				
			||||||
	Run:     loadCache,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func loadCache(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
					 | 
				
			||||||
	projectCache.Refresh(remotes...)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	cacheCmd.AddCommand(loadCmd)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	loadCmd.PersistentFlags().Bool("ownerOnly", true,
 | 
					 | 
				
			||||||
		"Only load projects that you are owner of")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	viper.BindPFlag("cache.load.ownerOnly", loadCmd.Flag("ownerOnly"))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,31 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var unlockCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:   "unlock",
 | 
					 | 
				
			||||||
	Short: "unlock GitLab project cache",
 | 
					 | 
				
			||||||
	Long:  `unlocks cache to display`,
 | 
					 | 
				
			||||||
	Run: func(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
		initProjectCache(cmd, args)
 | 
					 | 
				
			||||||
		if viper.GetBool("cache.unlock.force") {
 | 
					 | 
				
			||||||
			projectCache.UnlockCache()
 | 
					 | 
				
			||||||
		} else if yes, _ := pterm.DefaultInteractiveConfirm.
 | 
					 | 
				
			||||||
			WithDefaultValue(false).
 | 
					 | 
				
			||||||
			Show("Are you sure you want to manually unlock?"); yes {
 | 
					 | 
				
			||||||
			projectCache.UnlockCache()
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			plog.Error("You failed to confirm cache unlock")
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	cacheCmd.AddCommand(unlockCmd)
 | 
					 | 
				
			||||||
	unlockCmd.PersistentFlags().BoolP("force", "f", false, "force unlocks cache (don't ask)")
 | 
					 | 
				
			||||||
	viper.BindPFlag("cache.unlock.force", unlockCmd.LocalFlags().Lookup("force"))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,16 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var configCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:     "config",
 | 
					 | 
				
			||||||
	Short:   "GitLab Project Manager Configuration",
 | 
					 | 
				
			||||||
	Aliases: []string{"conf"},
 | 
					 | 
				
			||||||
	Long:    configCmdLong,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	rootCmd.AddCommand(configCmd)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										26
									
								
								cmd/config/config.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								cmd/config/config.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					package cmd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var ConfigCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:              "config",
 | 
				
			||||||
 | 
						Short:            "Git Project Manager Configuration",
 | 
				
			||||||
 | 
						Aliases:          []string{"conf"},
 | 
				
			||||||
 | 
						Long:             util.ConfigCmdLong,
 | 
				
			||||||
 | 
						PersistentPreRun: configCmdPreRun,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var utils *util.Utils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func configCmdPreRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils = util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						ConfigCmd.AddCommand(configGenerateCmd)
 | 
				
			||||||
 | 
						ConfigCmd.AddCommand(configShowCmd)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -8,16 +8,18 @@ import (
 | 
				
			|||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/config"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
					 | 
				
			||||||
	"gopkg.in/yaml.v3"
 | 
						"gopkg.in/yaml.v3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var configGenerateCmd = &cobra.Command{
 | 
					var configGenerateCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "generate",
 | 
						Use:     "generate",
 | 
				
			||||||
	Short:   "Generate a default configuration",
 | 
						Short:   "Generate a default configuration",
 | 
				
			||||||
	Aliases: []string{"gen", "new", "default"},
 | 
						Aliases: []string{"gen", "new", "default"},
 | 
				
			||||||
	Long:    configGenCmdLong,
 | 
						Long:    util.ConfigGenCmdLong,
 | 
				
			||||||
	Run:     runConfigGenerateCmd,
 | 
						Run:     runConfigGenerateCmd,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -26,46 +28,46 @@ func runConfigGenerateCmd(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
	if viper.ConfigFileUsed() != "" {
 | 
						if viper.ConfigFileUsed() != "" {
 | 
				
			||||||
		configFile = viper.ConfigFileUsed()
 | 
							configFile = viper.ConfigFileUsed()
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		configFile = defConfigPath
 | 
							configFile = util.DefConfigPath
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	plog.Debug("Using config file " + configFile)
 | 
						utils.Logger().Debug("Using config file " + configFile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	configFile, _ = resolvePath(configFile)
 | 
						configFile, _ = util.ResolvePath(configFile)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	newConf := promptConfigSettings(&conf)
 | 
						newConf := promptConfigSettings(utils.Config())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if write, _ := cmd.Flags().GetBool("write"); write {
 | 
						if write, _ := cmd.Flags().GetBool(util.FlagWrite); write {
 | 
				
			||||||
		write, _ := pterm.DefaultInteractiveContinue.
 | 
							write, _ := pterm.DefaultInteractiveContinue.
 | 
				
			||||||
			WithDefaultText("Really write config file?").
 | 
								WithDefaultText("Really write config file?").
 | 
				
			||||||
			WithOptions([]string{"yes", "no"}).
 | 
								WithOptions([]string{"yes", "no"}).
 | 
				
			||||||
			Show()
 | 
								Show()
 | 
				
			||||||
		if write != "yes" {
 | 
							if write != "yes" {
 | 
				
			||||||
			plog.Fatal("Aborting config file write")
 | 
								utils.Logger().Fatal("Aborting config file write")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		writeConfigFile(newConf, configFile)
 | 
							writeConfigFile(newConf, configFile)
 | 
				
			||||||
		plog.Info("Wrote config to file",
 | 
							utils.Logger().Info("Wrote config to file",
 | 
				
			||||||
			plog.Args("file", configFile))
 | 
								utils.Logger().Args("file", configFile))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		var c bytes.Buffer
 | 
							var c bytes.Buffer
 | 
				
			||||||
		enc := yaml.NewEncoder(&c)
 | 
							enc := yaml.NewEncoder(&c)
 | 
				
			||||||
		enc.SetIndent(2)
 | 
							enc.SetIndent(2)
 | 
				
			||||||
		enc.Encode(newConf)
 | 
							enc.Encode(newConf)
 | 
				
			||||||
		plog.Info("Suggest running with --write or redirect (> " + configFile + ")")
 | 
							utils.Logger().Info("Suggest running with --write or redirect (> " + configFile + ")")
 | 
				
			||||||
		fmt.Print(c.String())
 | 
							fmt.Print(c.String())
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func writeConfigFile(c *config.Config, path string) {
 | 
					func writeConfigFile(c *config.Config, path string) {
 | 
				
			||||||
	file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640)
 | 
						file, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o640)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		plog.Error("Failed to prepare config for writing", plog.Args("error", err))
 | 
							utils.Logger().Error("Failed to prepare config for writing", utils.Logger().Args("error", err))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	enc := yaml.NewEncoder(file)
 | 
						enc := yaml.NewEncoder(file)
 | 
				
			||||||
	if err := enc.Encode(c); err != nil {
 | 
						if err := enc.Encode(c); err != nil {
 | 
				
			||||||
		plog.Fatal("Failed writing config file", plog.Args("file", path))
 | 
							utils.Logger().Fatal("Failed writing config file", utils.Logger().Args("file", path))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -148,7 +150,6 @@ func promptConfigSettings(c *config.Config) *config.Config {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	configCmd.AddCommand(configGenerateCmd)
 | 
						configGenerateCmd.PersistentFlags().Bool(util.FlagPrompt, false, "Prompt for settings")
 | 
				
			||||||
	configGenerateCmd.PersistentFlags().Bool("prompt", false, "Prompt for settings")
 | 
						configGenerateCmd.PersistentFlags().Bool(util.FlagWrite, false, "Write config to file")
 | 
				
			||||||
	configGenerateCmd.PersistentFlags().Bool("write", false, "Write config to file")
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -6,26 +6,28 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"gopkg.in/yaml.v3"
 | 
						"gopkg.in/yaml.v3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var configShowCmd = &cobra.Command{
 | 
					var configShowCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "show",
 | 
						Use:     "show",
 | 
				
			||||||
	Short:   "Show GitLab Project Manager Configuration",
 | 
						Short:   "Show Git Project Manager Configuration",
 | 
				
			||||||
	Aliases: []string{"s", "dump", "cat", "ls"},
 | 
						Aliases: []string{"s", "dump", "cat", "ls"},
 | 
				
			||||||
	Run:     runConfigShowCmd,
 | 
						Run:     runConfigShowCmd,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func runConfigShowCmd(cmd *cobra.Command, args []string) {
 | 
					func runConfigShowCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	c := conf
 | 
						c := *utils.Config()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	showSensitive, _ := cmd.Flags().GetBool("sensitive")
 | 
						showSensitive, _ := cmd.Flags().GetBool(util.FlagSensitive)
 | 
				
			||||||
	if !showSensitive {
 | 
						if !showSensitive {
 | 
				
			||||||
		plog.Info("Sensitive fields hidden, do not use unreviewed as config")
 | 
							utils.Logger().Info("Sensitive fields hidden, do not use unreviewed as config")
 | 
				
			||||||
		for _, r := range c.Remotes {
 | 
							for _, r := range c.Remotes {
 | 
				
			||||||
			r.Token = strings.Repeat("*", len(r.Token))
 | 
								r.Token = strings.Repeat("*", len(r.Token))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		plog.Warn("Displaying sensitive fields!")
 | 
							utils.Logger().Warn("Displaying sensitive fields!")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	enc := yaml.NewEncoder(os.Stdout)
 | 
						enc := yaml.NewEncoder(os.Stdout)
 | 
				
			||||||
@@ -34,6 +36,5 @@ func runConfigShowCmd(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	configCmd.AddCommand(configShowCmd)
 | 
						configShowCmd.Flags().BoolP(util.FlagSensitive, "s", false, "Set to show sensitive fields")
 | 
				
			||||||
	configShowCmd.Flags().BoolP("sensitive", "s", false, "Set to show sensitive fields")
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										62
									
								
								cmd/docs.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								cmd/docs.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,62 @@
 | 
				
			|||||||
 | 
					package cmd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/cobra/doc"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var docsCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:       "docs",
 | 
				
			||||||
 | 
						Aliases:   []string{"documentation"},
 | 
				
			||||||
 | 
						Short:     "Generate documentation for git-project-manager",
 | 
				
			||||||
 | 
						Args:      cobra.RangeArgs(1, 1),
 | 
				
			||||||
 | 
						ValidArgs: []string{"md", "man", "yaml"},
 | 
				
			||||||
 | 
						Run:       runDocsCmd,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func runDocsCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						outDir, err := cmd.Flags().GetString(util.FlagDocsPath)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							utils.Logger().Error("missing docs path")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						prepareDocsDir(cmd, outDir)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						switch args[0] {
 | 
				
			||||||
 | 
						case "md":
 | 
				
			||||||
 | 
							err = doc.GenMarkdownTree(cmd.Root(), outDir)
 | 
				
			||||||
 | 
						case "man":
 | 
				
			||||||
 | 
							err = doc.GenManTree(cmd.Root(), &doc.GenManHeader{
 | 
				
			||||||
 | 
								Title:   "EIA Client",
 | 
				
			||||||
 | 
								Section: "1",
 | 
				
			||||||
 | 
							}, outDir)
 | 
				
			||||||
 | 
						case "yaml":
 | 
				
			||||||
 | 
							err = doc.GenYamlTree(cmd.Root(), outDir)
 | 
				
			||||||
 | 
						default:
 | 
				
			||||||
 | 
							utils.Logger().Error("invalid docs type", utils.Logger().Args("type", args[0]))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						utils.Logger().Info("docs generation complete", utils.Logger().Args(
 | 
				
			||||||
 | 
							"type", args[0], "docsDir", outDir, "err", err))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func prepareDocsDir(_ *cobra.Command, outDir string) {
 | 
				
			||||||
 | 
						_, err := os.Stat(outDir)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							err = os.Mkdir(outDir, 0o755)
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								utils.Logger().Error("failed to create docs path", utils.Logger().Args(
 | 
				
			||||||
 | 
									"error", err.Error(), "docsDir", outDir))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						docsCmd.PersistentFlags().StringP(util.FlagDocsPath, "d", "./docs", "specify output directory for documentation")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						rootCmd.AddCommand(docsCmd)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,66 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/cache"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var projectCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:               "project [fuzzy alias search]",
 | 
					 | 
				
			||||||
	Short:             "Use a GitLab project",
 | 
					 | 
				
			||||||
	Aliases:           []string{"proj", "projects", "p"},
 | 
					 | 
				
			||||||
	Args:              cobra.MaximumNArgs(1),
 | 
					 | 
				
			||||||
	ArgAliases:        []string{"alias"},
 | 
					 | 
				
			||||||
	Long:              projCmdLong,
 | 
					 | 
				
			||||||
	PersistentPreRun:  initProjectCmd,
 | 
					 | 
				
			||||||
	PersistentPostRun: postProjectCmd,
 | 
					 | 
				
			||||||
	// Run:               projectGoCmdRun,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func getProject(args []string) *projects.Project {
 | 
					 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
					 | 
				
			||||||
	fzfOpts := &fzfProjectOpts{
 | 
					 | 
				
			||||||
		Ctx:     rootCmd.Context(),
 | 
					 | 
				
			||||||
		Search:  searchStringFromArgs(args),
 | 
					 | 
				
			||||||
		Remotes: remotes,
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	project := fzfFindProject(fzfOpts)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if project == nil {
 | 
					 | 
				
			||||||
		plog.Fatal("Failed to find a project, nothing to do")
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		plog.Debug("Houston, we have a project", plog.Args(
 | 
					 | 
				
			||||||
			"project", project.String(),
 | 
					 | 
				
			||||||
			"aliases", cache.ProjectAliasesString(
 | 
					 | 
				
			||||||
				projectCache.GetProjectAliases(project)),
 | 
					 | 
				
			||||||
		))
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if len(projectCache.GetProjectAliases(project)) == 0 {
 | 
					 | 
				
			||||||
		plog.Info("New project, set aliases or press enter for default")
 | 
					 | 
				
			||||||
		addNewAliases(project.ID)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return project
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func initProjectCmd(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	initProjectCache(cmd, args)
 | 
					 | 
				
			||||||
	mustHaveProjects(cmd, args)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func postProjectCmd(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	postProjectCache(cmd, args)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	rootCmd.AddCommand(projectCmd)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func mustHaveProjects(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	if len(projectCache.Projects) == 0 {
 | 
					 | 
				
			||||||
		plog.Fatal("No projects to " + cmd.Name() + ", try running cache load")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										66
									
								
								cmd/project/project.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								cmd/project/project.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,66 @@
 | 
				
			|||||||
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/alias"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var ProjectCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:               "project [fuzzy alias search]",
 | 
				
			||||||
 | 
						Short:             "Use a Git project",
 | 
				
			||||||
 | 
						Aliases:           []string{"proj", "projects", "p"},
 | 
				
			||||||
 | 
						Args:              cobra.MaximumNArgs(1),
 | 
				
			||||||
 | 
						ArgAliases:        []string{"alias"},
 | 
				
			||||||
 | 
						Long:              util.ProjCmdLong,
 | 
				
			||||||
 | 
						PersistentPreRun:  projectCmdPreRun,
 | 
				
			||||||
 | 
						PersistentPostRun: util.PostProjectCmd,
 | 
				
			||||||
 | 
						// Run:               projectGoCmdRun,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var utils *util.Utils
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func projectCmdPreRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils = util.MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						util.InitProjects(cmd, args)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func getProject(cmd *cobra.Command, args []string) *projects.Project {
 | 
				
			||||||
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
 | 
						fzfOpts := &util.FzfProjectOpts{
 | 
				
			||||||
 | 
							Ctx:     cmd.Context(),
 | 
				
			||||||
 | 
							Search:  utils.SearchStringFromArgs(args),
 | 
				
			||||||
 | 
							Remotes: remotes,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						project := utils.FzfFindProject(fzfOpts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if project == nil {
 | 
				
			||||||
 | 
							utils.Logger().Fatal("Failed to find a project, nothing to do")
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							utils.Logger().Debug("Houston, we have a project", utils.Logger().Args(
 | 
				
			||||||
 | 
								"project", project.String(),
 | 
				
			||||||
 | 
								"aliases", cache.ProjectAliasesString(
 | 
				
			||||||
 | 
									utils.Cache().GetProjectAliases(project)),
 | 
				
			||||||
 | 
							))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if len(utils.Cache().GetProjectAliases(project)) == 0 {
 | 
				
			||||||
 | 
							utils.Logger().Info("New project, set aliases or press enter for default")
 | 
				
			||||||
 | 
							alias.AddNewAliases(cmd, project.GetID())
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return project
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						ProjectCmd.AddCommand(projectAddCmd)
 | 
				
			||||||
 | 
						ProjectCmd.AddCommand(projectGoCmd)
 | 
				
			||||||
 | 
						ProjectCmd.AddCommand(projectListCmd)
 | 
				
			||||||
 | 
						ProjectCmd.AddCommand(projectOpenCmd)
 | 
				
			||||||
 | 
						ProjectCmd.AddCommand(projectRunCmd)
 | 
				
			||||||
 | 
						ProjectCmd.AddCommand(projectShowCmd)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,21 +1,19 @@
 | 
				
			|||||||
package cmd
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var projectAddCmd = &cobra.Command{
 | 
					var projectAddCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "add",
 | 
						Use:     "add",
 | 
				
			||||||
	Short:   "Add a new GitLab project",
 | 
						Short:   "Add a new Git project",
 | 
				
			||||||
	Aliases: []string{"a", "alias"},
 | 
						Aliases: []string{"a", "alias"},
 | 
				
			||||||
	Long:    projAddCmdLong,
 | 
						Long:    util.ProjAddCmdLong,
 | 
				
			||||||
	Run:     projectAddCmdRun,
 | 
						Run:     projectAddCmdRun,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func projectAddCmdRun(cmd *cobra.Command, args []string) {
 | 
					func projectAddCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	getProject(args)
 | 
						getProject(cmd, args)
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	projectCmd.AddCommand(projectAddCmd)
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										53
									
								
								cmd/project/project_go.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								cmd/project/project_go.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
						"os/exec"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var projectGoCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:               "go [fuzzy alias search]",
 | 
				
			||||||
 | 
						Short:             "Go to a Git project",
 | 
				
			||||||
 | 
						Aliases:           []string{"goto", "cd"},
 | 
				
			||||||
 | 
						Args:              cobra.MaximumNArgs(1),
 | 
				
			||||||
 | 
						ArgAliases:        []string{"project"},
 | 
				
			||||||
 | 
						ValidArgsFunction: util.ValidAliasesFunc,
 | 
				
			||||||
 | 
						Long:              util.ProjGoCmdLong,
 | 
				
			||||||
 | 
						Run:               projectGoCmdRun,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func projectGoCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
 | 
						fzfOpts := &util.FzfProjectOpts{
 | 
				
			||||||
 | 
							Ctx:           cmd.Context(),
 | 
				
			||||||
 | 
							Search:        utils.SearchStringFromArgs(args),
 | 
				
			||||||
 | 
							MustHaveAlias: true,
 | 
				
			||||||
 | 
							Remotes:       remotes,
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						project := utils.FzfSearchProjectAliases(fzfOpts)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if project == nil {
 | 
				
			||||||
 | 
							utils.Logger().Fatal("No project selected, nowhere to go")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						utils.Cache().GoTo(project)
 | 
				
			||||||
 | 
						project.SetRepo(utils.Cache().OpenProject(cmd.Context(), project))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						utils.Logger().Debug("Project ready", utils.Logger().Args(
 | 
				
			||||||
 | 
							"path", utils.Cache().GetProjectPath(project),
 | 
				
			||||||
 | 
							"project", project,
 | 
				
			||||||
 | 
						))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						fmt.Fprintln(os.Stderr, project.GetGitInfo())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// This should be read by any source command, for instance
 | 
				
			||||||
 | 
						// `cd "$(git-project-manager projects cd somealias)"`
 | 
				
			||||||
 | 
						fmt.Println(utils.Cache().GetProjectPath(project))
 | 
				
			||||||
 | 
						exec.Command("cd", utils.Cache().GetProjectPath(project)).Run()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										28
									
								
								cmd/project/project_list.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								cmd/project/project_list.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var projectListCmd = &cobra.Command{
 | 
				
			||||||
 | 
						Use:     "list",
 | 
				
			||||||
 | 
						Short:   "List Git Projects",
 | 
				
			||||||
 | 
						Aliases: []string{"ls", "l"},
 | 
				
			||||||
 | 
						Long:    util.ProjListCmdLong,
 | 
				
			||||||
 | 
						Run:     projectListCmdRun,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func projectListCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
 | 
						fmt.Println(utils.Cache().DumpString(viper.GetBool(util.ViperProjectListAll), utils.SearchStringFromArgs(args), remotes...))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						projectListCmd.PersistentFlags().Bool(util.FlagAll, false, "List all, not just cloned locally")
 | 
				
			||||||
 | 
						viper.BindPFlag(util.ViperProjectListAll, projectListCmd.Flag(util.FlagAll))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
package cmd
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/exec"
 | 
						"os/exec"
 | 
				
			||||||
@@ -8,6 +9,8 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var projectOpenCmd = &cobra.Command{
 | 
					var projectOpenCmd = &cobra.Command{
 | 
				
			||||||
@@ -15,8 +18,8 @@ var projectOpenCmd = &cobra.Command{
 | 
				
			|||||||
	Short:             "Open project in your IDE",
 | 
						Short:             "Open project in your IDE",
 | 
				
			||||||
	Aliases:           []string{"goto", "cd"},
 | 
						Aliases:           []string{"goto", "cd"},
 | 
				
			||||||
	Args:              cobra.OnlyValidArgs,
 | 
						Args:              cobra.OnlyValidArgs,
 | 
				
			||||||
	ValidArgsFunction: validAliasesFunc,
 | 
						ValidArgsFunction: util.ValidAliasesFunc,
 | 
				
			||||||
	Long:              projOpenCmdLong,
 | 
						Long:              util.ProjOpenCmdLong,
 | 
				
			||||||
	Run:               projectOpenCmdRun,
 | 
						Run:               projectOpenCmdRun,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -48,47 +51,47 @@ func projectOpenCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
	// Find an editor
 | 
						// Find an editor
 | 
				
			||||||
	editor := findEditor()
 | 
						editor := findEditor()
 | 
				
			||||||
	if editor == "" {
 | 
						if editor == "" {
 | 
				
			||||||
		plog.Fatal("No usable editor found")
 | 
							utils.Logger().Fatal("No usable editor found")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
	fzfOpts := &fzfProjectOpts{
 | 
						fzfOpts := &util.FzfProjectOpts{
 | 
				
			||||||
		Ctx:     cmd.Context(),
 | 
							Ctx:     cmd.Context(),
 | 
				
			||||||
		Search:  searchStringFromArgs(args),
 | 
							Search:  utils.SearchStringFromArgs(args),
 | 
				
			||||||
		Remotes: remotes,
 | 
							Remotes: remotes,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	project := fzfCwdOrSearchProjectAliases(fzfOpts)
 | 
						project := utils.FzfCwdOrSearchProjectAliases(fzfOpts)
 | 
				
			||||||
	if project == nil {
 | 
						if project == nil {
 | 
				
			||||||
		plog.Fatal("No project to open, nothing to do")
 | 
							utils.Logger().Fatal("No project to open, nothing to do")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Check the project
 | 
						// Check the project
 | 
				
			||||||
	path := projectCache.GetProjectPath(project)
 | 
						path := utils.Cache().GetProjectPath(project)
 | 
				
			||||||
	if _, err := os.Stat(path); err != nil {
 | 
						if _, err := os.Stat(path); err != nil {
 | 
				
			||||||
		plog.Fatal("Unable to open project", plog.Args("error", err))
 | 
							utils.Logger().Fatal("Unable to open project", utils.Logger().Args("error", err))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Open the project with the editor
 | 
						// Open the project with the editor
 | 
				
			||||||
	file := getEntrypointFile(path)
 | 
						file := getEntrypointFile(path)
 | 
				
			||||||
	openEditor(editor, path+"/"+file)
 | 
						openEditor(cmd.Context(), editor, path+"/"+file)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func openEditor(editor string, path string) {
 | 
					func openEditor(ctx context.Context, editor string, path string) {
 | 
				
			||||||
	// Compile arguments
 | 
						// Compile arguments
 | 
				
			||||||
	args := make([]string, 0, 1)
 | 
						args := make([]string, 0, 1)
 | 
				
			||||||
	if conf.Editor.OpenFlags != "" {
 | 
						if utils.Config().Editor.OpenFlags != "" {
 | 
				
			||||||
		args = append(args, conf.Editor.OpenFlags)
 | 
							args = append(args, utils.Config().Editor.OpenFlags)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	args = append(args, path)
 | 
						args = append(args, path)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Launch editor
 | 
						// Launch editor
 | 
				
			||||||
	cmd := exec.CommandContext(rootCmd.Context(), editor, args...)
 | 
						cmd := exec.CommandContext(ctx, editor, args...)
 | 
				
			||||||
	cmd.Dir = filepath.Dir(path)
 | 
						cmd.Dir = filepath.Dir(path)
 | 
				
			||||||
	cmd.Stdout = os.Stdout
 | 
						cmd.Stdout = os.Stdout
 | 
				
			||||||
	cmd.Stderr = os.Stderr
 | 
						cmd.Stderr = os.Stderr
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err := cmd.Run(); err != nil {
 | 
						if err := cmd.Run(); err != nil {
 | 
				
			||||||
		plog.Error("Failed to open project", plog.Args(
 | 
							utils.Logger().Error("Failed to open project", utils.Logger().Args(
 | 
				
			||||||
			"error", err.Error(),
 | 
								"error", err.Error(),
 | 
				
			||||||
			"command", cmd.String(),
 | 
								"command", cmd.String(),
 | 
				
			||||||
		))
 | 
							))
 | 
				
			||||||
@@ -100,7 +103,7 @@ func openEditor(editor string, path string) {
 | 
				
			|||||||
func getEntrypointFile(projectPath string) string {
 | 
					func getEntrypointFile(projectPath string) string {
 | 
				
			||||||
	if err := os.Chdir(projectPath); err != nil {
 | 
						if err := os.Chdir(projectPath); err != nil {
 | 
				
			||||||
		return ""
 | 
							return ""
 | 
				
			||||||
	} else if conf.Editor.OpenDirectory {
 | 
						} else if utils.Config().Editor.OpenDirectory {
 | 
				
			||||||
		return "."
 | 
							return "."
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -119,10 +122,10 @@ func findEditor() string {
 | 
				
			|||||||
	var err error
 | 
						var err error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// First try configured editor
 | 
						// First try configured editor
 | 
				
			||||||
	if conf.Editor.Binary != "" {
 | 
						if utils.Config().Editor.Binary != "" {
 | 
				
			||||||
		editor, err = getEditor(conf.Editor.Binary)
 | 
							editor, err = getEditor(utils.Config().Editor.Binary)
 | 
				
			||||||
		if err != nil || editor == "" {
 | 
							if err != nil || editor == "" {
 | 
				
			||||||
			plog.Error("Configured editor is not usable, finding others", plog.Args(
 | 
								utils.Logger().Error("Configured editor is not usable, finding others", utils.Logger().Args(
 | 
				
			||||||
				"error", err,
 | 
									"error", err,
 | 
				
			||||||
			))
 | 
								))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -130,7 +133,7 @@ func findEditor() string {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Then try to find a known editor
 | 
						// Then try to find a known editor
 | 
				
			||||||
	if editor == "" || err != nil {
 | 
						if editor == "" || err != nil {
 | 
				
			||||||
		conf.Editor.OpenFlags = ""
 | 
							utils.Config().Editor.OpenFlags = ""
 | 
				
			||||||
		for _, e := range knownEditors {
 | 
							for _, e := range knownEditors {
 | 
				
			||||||
			path, err := getEditor(e)
 | 
								path, err := getEditor(e)
 | 
				
			||||||
			if err == nil && path != "" {
 | 
								if err == nil && path != "" {
 | 
				
			||||||
@@ -140,9 +143,9 @@ func findEditor() string {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	plog.Debug("Editor found for open", plog.Args(
 | 
						utils.Logger().Debug("Editor found for open", utils.Logger().Args(
 | 
				
			||||||
		"editor", editor,
 | 
							"editor", editor,
 | 
				
			||||||
		"command", editor+" "+conf.Editor.OpenFlags,
 | 
							"command", editor+" "+utils.Config().Editor.OpenFlags,
 | 
				
			||||||
	))
 | 
						))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return editor
 | 
						return editor
 | 
				
			||||||
@@ -152,7 +155,7 @@ func getEditor(editor string) (string, error) {
 | 
				
			|||||||
	path, err := getEditorPath(editor)
 | 
						path, err := getEditorPath(editor)
 | 
				
			||||||
	if path != "" && err == nil {
 | 
						if path != "" && err == nil {
 | 
				
			||||||
		if !isEditorExecutable(path) {
 | 
							if !isEditorExecutable(path) {
 | 
				
			||||||
			err = errors.New("Editor is not executable")
 | 
								err = errors.New("editor is not executable")
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return path, err
 | 
						return path, err
 | 
				
			||||||
@@ -164,7 +167,7 @@ func getEditorPath(editor string) (string, error) {
 | 
				
			|||||||
		editor, _ = exec.LookPath(editor)
 | 
							editor, _ = exec.LookPath(editor)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return resolvePath(editor)
 | 
						return util.ResolvePath(editor)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func isEditorExecutable(editor string) bool {
 | 
					func isEditorExecutable(editor string) bool {
 | 
				
			||||||
@@ -172,7 +175,7 @@ func isEditorExecutable(editor string) bool {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	stat, err := os.Stat(editor)
 | 
						stat, err := os.Stat(editor)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err == nil && (stat.Mode()&0444 != 0 && stat.Mode()&0111 != 0) {
 | 
						if err == nil && (stat.Mode()&0o444 != 0 && stat.Mode()&0o111 != 0) {
 | 
				
			||||||
		canExec = true
 | 
							canExec = true
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -180,7 +183,6 @@ func isEditorExecutable(editor string) bool {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	projectCmd.AddCommand(projectOpenCmd)
 | 
					 | 
				
			||||||
	projectOpenCmd.PersistentFlags().String("displayName", "", "Set display name of editor (meant for config file)")
 | 
						projectOpenCmd.PersistentFlags().String("displayName", "", "Set display name of editor (meant for config file)")
 | 
				
			||||||
	projectOpenCmd.PersistentFlags().String("binary", "", "Path to editor binary")
 | 
						projectOpenCmd.PersistentFlags().String("binary", "", "Path to editor binary")
 | 
				
			||||||
	projectOpenCmd.PersistentFlags().String("openFlags", "", "Optional flags when opening project (e.g. --reuse-window)")
 | 
						projectOpenCmd.PersistentFlags().String("openFlags", "", "Optional flags when opening project (e.g. --reuse-window)")
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package cmd
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
@@ -7,35 +7,37 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var projectRunCmd = &cobra.Command{
 | 
					var projectRunCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "run",
 | 
						Use:     "run",
 | 
				
			||||||
	Short:   "Run the project (e.g. go run .)",
 | 
						Short:   "Run the project (e.g. go run .)",
 | 
				
			||||||
	Aliases: []string{"exec", "r"},
 | 
						Aliases: []string{"exec", "r"},
 | 
				
			||||||
	Long:    projRunCmdLong,
 | 
						Long:    util.ProjRunCmdLong,
 | 
				
			||||||
	Run:     projectRunCmdRun,
 | 
						Run:     projectRunCmdRun,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func projectRunCmdRun(cmd *cobra.Command, args []string) {
 | 
					func projectRunCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
	fzfOpts := &fzfProjectOpts{
 | 
						fzfOpts := &util.FzfProjectOpts{
 | 
				
			||||||
		Ctx:     cmd.Context(),
 | 
							Ctx:     cmd.Context(),
 | 
				
			||||||
		Search:  searchStringFromArgs(args),
 | 
							Search:  utils.SearchStringFromArgs(args),
 | 
				
			||||||
		Remotes: remotes,
 | 
							Remotes: remotes,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	project := fzfCwdOrSearchProjectAliases(fzfOpts)
 | 
						project := utils.FzfCwdOrSearchProjectAliases(fzfOpts)
 | 
				
			||||||
	if project == nil {
 | 
						if project == nil {
 | 
				
			||||||
		plog.Fatal("No project selected, nothing to open")
 | 
							utils.Logger().Fatal("No project selected, nothing to open")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	lang := project.GetLanguage()
 | 
						lang := project.GetLanguage()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if lang == nil {
 | 
						if lang == nil {
 | 
				
			||||||
		plog.Fatal("GitLab isn't sure what language this project is... can't run.")
 | 
							utils.Logger().Fatal("Git remote isn't sure what language this project is... can't run.")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	plog.Debug(fmt.Sprintf("Project is written in %s, %.2f%% coverage", lang.Name, lang.Percentage))
 | 
						utils.Logger().Debug(fmt.Sprintf("Project is written in %s, %.2f%% coverage", lang.Name, lang.Percentage))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	switch lang.Name {
 | 
						switch lang.Name {
 | 
				
			||||||
	case "Go":
 | 
						case "Go":
 | 
				
			||||||
@@ -50,5 +52,5 @@ func projectRunCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	projectCmd.AddCommand(projectRunCmd)
 | 
						ProjectCmd.AddCommand(projectRunCmd)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
package cmd
 | 
					package project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
@@ -7,15 +7,17 @@ import (
 | 
				
			|||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var projectShowCmd = &cobra.Command{
 | 
					var projectShowCmd = &cobra.Command{
 | 
				
			||||||
	Use:     "show [fuzzy alias search]",
 | 
						Use:     "show [fuzzy alias search]",
 | 
				
			||||||
	Short:   "Show detail for a GitLab project",
 | 
						Short:   "Show detail for a Git project",
 | 
				
			||||||
	Aliases: []string{"cat", "s"},
 | 
						Aliases: []string{"cat", "s"},
 | 
				
			||||||
	Args:    cobra.ArbitraryArgs,
 | 
						Args:    cobra.ArbitraryArgs,
 | 
				
			||||||
	Long:    projShowCmdLong,
 | 
						Long:    util.ProjShowCmdLong,
 | 
				
			||||||
	Run:     projectShowCmdRun,
 | 
						Run:     projectShowCmdRun,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -23,24 +25,24 @@ func projectShowCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
	var project *projects.Project
 | 
						var project *projects.Project
 | 
				
			||||||
	var inCwd bool
 | 
						var inCwd bool
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
						remotes := viper.GetStringSlice(util.FlagRemote)
 | 
				
			||||||
	fzfOpts := &fzfProjectOpts{
 | 
						fzfOpts := &util.FzfProjectOpts{
 | 
				
			||||||
		Ctx:     cmd.Context(),
 | 
							Ctx:     cmd.Context(),
 | 
				
			||||||
		Search:  searchStringFromArgs(args),
 | 
							Search:  utils.SearchStringFromArgs(args),
 | 
				
			||||||
		Remotes: remotes,
 | 
							Remotes: remotes,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Try to find project from current directory
 | 
						// Try to find project from current directory
 | 
				
			||||||
	if viper.GetBool("project.show.current") {
 | 
						if viper.GetBool(util.ViperProjectShowCurrent) {
 | 
				
			||||||
		var err error
 | 
							var err error
 | 
				
			||||||
		project, err = projectCache.GetProjectFromCwd()
 | 
							project, err = utils.Cache().GetProjectFromCwd()
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
			// Not an error because we're still going to try to find a project
 | 
								// Not an error because we're still going to try to find a project
 | 
				
			||||||
			plog.Warn("Failed to get project from current directory", plog.Args(
 | 
								utils.Logger().Warn("Failed to get project from current directory", utils.Logger().Args(
 | 
				
			||||||
				"error", err,
 | 
									"error", err,
 | 
				
			||||||
			))
 | 
								))
 | 
				
			||||||
		} else if project == nil {
 | 
							} else if project == nil {
 | 
				
			||||||
			plog.Warn("Failed to use --current flag, project not found in current path")
 | 
								utils.Logger().Warn("Failed to use --current flag, project not found in current path")
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
			inCwd = true
 | 
								inCwd = true
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -48,15 +50,15 @@ func projectShowCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Otherwise find from the given search string
 | 
						// Otherwise find from the given search string
 | 
				
			||||||
	if project == nil {
 | 
						if project == nil {
 | 
				
			||||||
		project = fzfFindProject(fzfOpts)
 | 
							project = utils.FzfFindProject(fzfOpts)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Do a full fuzzy find if all else fails
 | 
						// Do a full fuzzy find if all else fails
 | 
				
			||||||
	if project == nil {
 | 
						if project == nil {
 | 
				
			||||||
		var err error
 | 
							var err error
 | 
				
			||||||
		project, err = fzfProject(fzfOpts)
 | 
							project, err = utils.FzfProject(fzfOpts)
 | 
				
			||||||
		if err != nil || project == nil {
 | 
							if err != nil || project == nil {
 | 
				
			||||||
			plog.Fatal("Failed to find project, nothing to show", plog.Args(
 | 
								utils.Logger().Fatal("Failed to find project, nothing to show", utils.Logger().Args(
 | 
				
			||||||
				"error", err,
 | 
									"error", err,
 | 
				
			||||||
			))
 | 
								))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -67,17 +69,17 @@ func projectShowCmdRun(cmd *cobra.Command, args []string) {
 | 
				
			|||||||
		WithLeftPadding(5).WithRightPadding(5).
 | 
							WithLeftPadding(5).WithRightPadding(5).
 | 
				
			||||||
		WithBoxStyle(&pterm.Style{pterm.FgLightBlue}).
 | 
							WithBoxStyle(&pterm.Style{pterm.FgLightBlue}).
 | 
				
			||||||
		WithTitle(pterm.Bold.Sprint(pterm.LightGreen("Project Information"))).
 | 
							WithTitle(pterm.Bold.Sprint(pterm.LightGreen("Project Information"))).
 | 
				
			||||||
		Println(projectCache.ProjectString(project))
 | 
							Println(utils.Cache().ProjectString(project))
 | 
				
			||||||
	fmt.Println()
 | 
						fmt.Println()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if inCwd {
 | 
						if inCwd {
 | 
				
			||||||
		project.SetRepo(projectCache.OpenProject(cmd.Context(), project))
 | 
							project.SetRepo(utils.Cache().OpenProject(cmd.Context(), project))
 | 
				
			||||||
		fmt.Fprintln(os.Stderr, project.GetGitInfo()+"\n")
 | 
							fmt.Fprintln(os.Stderr, project.GetGitInfo()+"\n")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	projectCmd.AddCommand(projectShowCmd)
 | 
						ProjectCmd.AddCommand(projectShowCmd)
 | 
				
			||||||
	projectShowCmd.PersistentFlags().Bool("current", false, "Use project in CWD rather than fuzzy find")
 | 
						projectShowCmd.PersistentFlags().Bool(util.FlagCurrent, false, "Use project in CWD rather than fuzzy find")
 | 
				
			||||||
	viper.BindPFlag("project.show.current", projectShowCmd.Flag("current"))
 | 
						viper.BindPFlag(util.ViperProjectShowCurrent, projectShowCmd.Flag(util.FlagCurrent))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -1,55 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
	"os"
 | 
					 | 
				
			||||||
	"os/exec"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var projectGoCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:               "go [fuzzy alias search]",
 | 
					 | 
				
			||||||
	Short:             "Go to a GitLab project",
 | 
					 | 
				
			||||||
	Aliases:           []string{"goto", "cd"},
 | 
					 | 
				
			||||||
	Args:              cobra.MaximumNArgs(1),
 | 
					 | 
				
			||||||
	ArgAliases:        []string{"project"},
 | 
					 | 
				
			||||||
	ValidArgsFunction: validAliasesFunc,
 | 
					 | 
				
			||||||
	Long:              projGoCmdLong,
 | 
					 | 
				
			||||||
	Run:               projectGoCmdRun,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func projectGoCmdRun(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
					 | 
				
			||||||
	fzfOpts := &fzfProjectOpts{
 | 
					 | 
				
			||||||
		Ctx:           cmd.Context(),
 | 
					 | 
				
			||||||
		Search:        searchStringFromArgs(args),
 | 
					 | 
				
			||||||
		MustHaveAlias: true,
 | 
					 | 
				
			||||||
		Remotes:       remotes,
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	project := fzfSearchProjectAliases(fzfOpts)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if project == nil {
 | 
					 | 
				
			||||||
		plog.Fatal("No project selected, nowhere to go")
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	projectCache.GoTo(project)
 | 
					 | 
				
			||||||
	project.SetRepo(projectCache.OpenProject(cmd.Context(), project))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	plog.Debug("Project ready", plog.Args(
 | 
					 | 
				
			||||||
		"path", projectCache.GetProjectPath(project),
 | 
					 | 
				
			||||||
		"project", project,
 | 
					 | 
				
			||||||
	))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	fmt.Fprintln(os.Stderr, project.GetGitInfo())
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// This should be read by any source command, for instance
 | 
					 | 
				
			||||||
	// `cd "$(gitlab-project-manager projects cd somealias)"`
 | 
					 | 
				
			||||||
	fmt.Println(projectCache.GetProjectPath(project))
 | 
					 | 
				
			||||||
	exec.Command("cd", projectCache.GetProjectPath(project)).Run()
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	projectCmd.AddCommand(projectGoCmd)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,27 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"fmt"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"github.com/spf13/viper"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var projectListCmd = &cobra.Command{
 | 
					 | 
				
			||||||
	Use:     "list",
 | 
					 | 
				
			||||||
	Short:   "List GitLab Projects",
 | 
					 | 
				
			||||||
	Aliases: []string{"ls", "l"},
 | 
					 | 
				
			||||||
	Long:    projListCmdLong,
 | 
					 | 
				
			||||||
	Run:     projectListCmdRun,
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func projectListCmdRun(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	remotes := viper.GetStringSlice("remote")
 | 
					 | 
				
			||||||
	fmt.Println(projectCache.DumpString(viper.GetBool("project.list.all"), searchStringFromArgs(args), remotes...))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func init() {
 | 
					 | 
				
			||||||
	projectCmd.AddCommand(projectListCmd)
 | 
					 | 
				
			||||||
	projectListCmd.PersistentFlags().Bool("all", false, "List all, not just cloned locally")
 | 
					 | 
				
			||||||
	viper.BindPFlag("project.list.all", projectListCmd.Flag("all"))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
							
								
								
									
										161
									
								
								cmd/root.go
									
									
									
									
									
								
							
							
						
						
									
										161
									
								
								cmd/root.go
									
									
									
									
									
								
							@@ -4,29 +4,40 @@ import (
 | 
				
			|||||||
	"context"
 | 
						"context"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/signal"
 | 
						"os/signal"
 | 
				
			||||||
 | 
						"path/filepath"
 | 
				
			||||||
 | 
						"regexp"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
	"github.com/spf13/viper"
 | 
						"github.com/spf13/viper"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/config"
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/alias"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/cache"
 | 
				
			||||||
 | 
						conf "gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/config"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/project"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/cmd/util"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var conf config.Config
 | 
					 | 
				
			||||||
var plog *pterm.Logger
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
var rootCmd = &cobra.Command{
 | 
					var rootCmd = &cobra.Command{
 | 
				
			||||||
	Use:              "gitlab-project-manager",
 | 
						Use:              "git-project-manager",
 | 
				
			||||||
	Aliases:          []string{"gpm"},
 | 
						Aliases:          []string{"gpm"},
 | 
				
			||||||
	Short:            "Find and use GitLab projects locally",
 | 
						Short:            "Find and use Git projects locally",
 | 
				
			||||||
	Long:             rootCmdLong,
 | 
						Long:             util.RootCmdLong,
 | 
				
			||||||
	PersistentPreRun: initRootCmd,
 | 
						PersistentPreRun: initRootCmd,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var (
 | 
				
			||||||
 | 
						utils                *util.Utils
 | 
				
			||||||
 | 
						configExemptCommands = regexp.MustCompile(`^(doc|conf)`)
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Hook traversal is enabled, so this will be run for all
 | 
					// Hook traversal is enabled, so this will be run for all
 | 
				
			||||||
// sub-commands regardless of their registered pre-hooks
 | 
					// sub-commands regardless of their registered pre-hooks
 | 
				
			||||||
func initRootCmd(cmd *cobra.Command, args []string) {
 | 
					func initRootCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
	initProjectPath(cmd, args)
 | 
						cmd.SetContext(util.AddToCtx(cmd.Context(), utils))
 | 
				
			||||||
 | 
						utils.InitProjectPath(cmd, args)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Execute adds all child commands to the root command and sets flags appropriately.
 | 
					// Execute adds all child commands to the root command and sets flags appropriately.
 | 
				
			||||||
@@ -36,81 +47,95 @@ func Execute() {
 | 
				
			|||||||
	defer cncl()
 | 
						defer cncl()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err := rootCmd.ExecuteContext(ctx)
 | 
						err := rootCmd.ExecuteContext(ctx)
 | 
				
			||||||
 | 
					 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		pterm.Error.Printfln(pterm.LightYellow("Command failed, " + err.Error()))
 | 
							pterm.Error.Printfln("%s", pterm.LightYellow("Command failed, "+err.Error()))
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	cobra.EnableTraverseRunHooks = true
 | 
						cobra.EnableTraverseRunHooks = true
 | 
				
			||||||
	cobra.OnInitialize(initConfig)
 | 
					
 | 
				
			||||||
 | 
						utils = &util.Utils{}
 | 
				
			||||||
 | 
						cobra.OnInitialize(getInitConfigFunc(utils))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Global flags
 | 
						// Global flags
 | 
				
			||||||
	rootCmd.PersistentFlags().String("config", "",
 | 
						rootCmd.PersistentFlags().String(util.FlagConfig, "",
 | 
				
			||||||
		"config file (default is "+defConfigPath+")")
 | 
							"config file (default is "+util.DefConfigPath+")")
 | 
				
			||||||
	rootCmd.PersistentFlags().String("projectPath", "",
 | 
						rootCmd.PersistentFlags().String(util.FlagPath, "",
 | 
				
			||||||
		"Sets a path for local clones of projects")
 | 
							"Sets a path for local clones of projects")
 | 
				
			||||||
	rootCmd.PersistentFlags().String("logLevel", defLogLevel,
 | 
						rootCmd.PersistentFlags().String(util.FlagLogLevel, util.DefLogLevel,
 | 
				
			||||||
		"Default log level -- info, warn, error, debug")
 | 
							"Default log level -- info, warn, error, debug")
 | 
				
			||||||
	rootCmd.PersistentFlags().StringSlice("remote", []string{},
 | 
						rootCmd.PersistentFlags().StringSlice(util.FlagRemote, []string{},
 | 
				
			||||||
		"Specify remotes by host for any sub-command. Provide multiple times or comma delimited.")
 | 
							"Specify remotes by host for any sub-command. Provide multiple times or comma delimited.")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Flag autocompletion
 | 
					 | 
				
			||||||
	rootCmd.RegisterFlagCompletionFunc("logLevel", validLogLevelsFunc)
 | 
					 | 
				
			||||||
	rootCmd.RegisterFlagCompletionFunc("remote", validRemotesFunc)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	viper.BindPFlags(rootCmd.PersistentFlags())
 | 
						viper.BindPFlags(rootCmd.PersistentFlags())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Flag autocompletion
 | 
				
			||||||
 | 
						rootCmd.RegisterFlagCompletionFunc(util.FlagLogLevel, util.ValidLogLevelsFunc)
 | 
				
			||||||
 | 
						rootCmd.RegisterFlagCompletionFunc(util.FlagRemote, util.ValidRemotesFunc)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Subcommands
 | 
				
			||||||
 | 
						rootCmd.AddCommand(alias.AliasCmd)
 | 
				
			||||||
 | 
						rootCmd.AddCommand(cache.CacheCmd)
 | 
				
			||||||
 | 
						rootCmd.AddCommand(conf.ConfigCmd)
 | 
				
			||||||
 | 
						rootCmd.AddCommand(project.ProjectCmd)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// initConfig reads in config file and ENV variables if set.
 | 
					// initConfig reads in config file and ENV variables if set.
 | 
				
			||||||
func initConfig() {
 | 
					func getInitConfigFunc(utils *util.Utils) func() {
 | 
				
			||||||
	cfgFile := viper.GetString("config")
 | 
						return func() {
 | 
				
			||||||
	if cfgFile != "" {
 | 
							cfgFile := viper.GetString(util.FlagConfig)
 | 
				
			||||||
		// Use config file from the flag.
 | 
							if cfgFile != "" {
 | 
				
			||||||
		viper.SetConfigFile(cfgFile)
 | 
								// Use config file from the flag.
 | 
				
			||||||
	} else {
 | 
								viper.SetConfigFile(cfgFile)
 | 
				
			||||||
		// Find home directory.
 | 
							} else {
 | 
				
			||||||
		home, err := os.UserHomeDir()
 | 
								// Find home directory.
 | 
				
			||||||
		cobra.CheckErr(err)
 | 
								home, err := os.UserHomeDir()
 | 
				
			||||||
 | 
								cobra.CheckErr(err)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Search config in home directory with name ".gitlab-project-manager" (without extension).
 | 
								// Search config in home directory with name ".git-project-manager" (without extension).
 | 
				
			||||||
		viper.AddConfigPath(home + "/.config")
 | 
								configPath := filepath.Join(home, ".config")
 | 
				
			||||||
		viper.SetConfigType("yaml")
 | 
								viper.AddConfigPath(configPath)
 | 
				
			||||||
		viper.SetConfigName("gitlab-project-manager")
 | 
								viper.SetConfigType("yaml")
 | 
				
			||||||
 | 
								viper.SetConfigName(util.GetConfigName(configPath))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							viper.AutomaticEnv()
 | 
				
			||||||
 | 
							viper.ReadInConfig()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Configure pretty logger
 | 
				
			||||||
 | 
							plog := pterm.DefaultLogger.
 | 
				
			||||||
 | 
								WithLevel(getPtermLogLevel(viper.GetString(util.FlagLogLevel))).
 | 
				
			||||||
 | 
								WithWriter(os.Stderr)
 | 
				
			||||||
 | 
							if plog.Level == pterm.LogLevelDebug {
 | 
				
			||||||
 | 
								pterm.EnableDebugMessages()
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							utils.SetLogger(plog)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// Load into struct to not be so darn pythonic, retrieving
 | 
				
			||||||
 | 
							// settings by untyped string "name"
 | 
				
			||||||
 | 
							conf := new(config.Config)
 | 
				
			||||||
 | 
							if err := viper.Unmarshal(&conf); err != nil {
 | 
				
			||||||
 | 
								plog.Error("Failed loading config", plog.Args("err", err))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							utils.SetConfig(conf)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if len(os.Args) > 0 && configExemptCommands.Match([]byte(os.Args[1])) {
 | 
				
			||||||
 | 
								plog.Debug("Permitting missing config for config sub-command")
 | 
				
			||||||
 | 
								return
 | 
				
			||||||
 | 
							} else if conf.ProjectPath == "" {
 | 
				
			||||||
 | 
								plog.Fatal("Minimal configuration missing, must have projectPath", plog.Args(
 | 
				
			||||||
 | 
									"do",
 | 
				
			||||||
 | 
									"Try running `git-project-manager config default > "+util.DefConfigPath,
 | 
				
			||||||
 | 
								))
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							checkConfigPerms(viper.ConfigFileUsed()) // Abort on world-readable config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							utils.Logger().Debug("Configuration loaded", plog.Args("conf", conf))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					 | 
				
			||||||
	viper.AutomaticEnv()
 | 
					 | 
				
			||||||
	viper.ReadInConfig()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Configure pretty logger
 | 
					 | 
				
			||||||
	plog = pterm.DefaultLogger.
 | 
					 | 
				
			||||||
		WithLevel(getPtermLogLevel(viper.GetString("logLevel"))).
 | 
					 | 
				
			||||||
		WithWriter(os.Stderr)
 | 
					 | 
				
			||||||
	if plog.Level == pterm.LogLevelDebug {
 | 
					 | 
				
			||||||
		pterm.EnableDebugMessages()
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Load into struct to not be so darn pythonic, retrieving
 | 
					 | 
				
			||||||
	// settings by untyped string "name"
 | 
					 | 
				
			||||||
	if err := viper.Unmarshal(&conf); err != nil {
 | 
					 | 
				
			||||||
		plog.Error("Failed loading config", plog.Args("err", err))
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if len(os.Args) > 0 && strings.HasPrefix(os.Args[1], "conf") {
 | 
					 | 
				
			||||||
		plog.Debug("Permitting missing config for config sub-command")
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	} else if conf.ProjectPath == "" {
 | 
					 | 
				
			||||||
		plog.Fatal("Minimal configuration missing, must have projectPath", plog.Args(
 | 
					 | 
				
			||||||
			"do",
 | 
					 | 
				
			||||||
			"Try running `gitlab-project-manager config default > "+defConfigPath,
 | 
					 | 
				
			||||||
		))
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	checkConfigPerms(viper.ConfigFileUsed()) // Abort on world-readable config
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	plog.Debug("Configuration loaded", plog.Args("conf", conf))
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func getPtermLogLevel(level string) pterm.LogLevel {
 | 
					func getPtermLogLevel(level string) pterm.LogLevel {
 | 
				
			||||||
@@ -134,12 +159,12 @@ func getPtermLogLevel(level string) pterm.LogLevel {
 | 
				
			|||||||
func checkConfigPerms(file string) {
 | 
					func checkConfigPerms(file string) {
 | 
				
			||||||
	stat, err := os.Stat(file)
 | 
						stat, err := os.Stat(file)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		plog.Error("Failure reading configuration", plog.Args("err", err))
 | 
							utils.Logger().Error("Failure reading configuration", utils.Logger().Args("err", err))
 | 
				
			||||||
		return
 | 
							return
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if stat.Mode().Perm()&0004 == 0004 {
 | 
						if stat.Mode().Perm()&0o004 == 0o004 {
 | 
				
			||||||
		plog.Error("Configuration is world-readable. Recomment 0400.",
 | 
							utils.Logger().Error("Configuration is world-readable. Recomment 0400.",
 | 
				
			||||||
			plog.Args("mode", stat.Mode().String()))
 | 
								utils.Logger().Args("mode", stat.Mode().String()))
 | 
				
			||||||
		os.Exit(1)
 | 
							os.Exit(1)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										121
									
								
								cmd/util/util.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										121
									
								
								cmd/util/util.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,121 @@
 | 
				
			|||||||
 | 
					// Common utilities used by various subcommands
 | 
				
			||||||
 | 
					package util
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"context"
 | 
				
			||||||
 | 
						"errors"
 | 
				
			||||||
 | 
						"sync"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
 | 
				
			||||||
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Utils struct {
 | 
				
			||||||
 | 
						ctx    context.Context
 | 
				
			||||||
 | 
						config *config.Config
 | 
				
			||||||
 | 
						logger *pterm.Logger
 | 
				
			||||||
 | 
						cache  *cache.Cache
 | 
				
			||||||
 | 
						sync.RWMutex
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type UtilOpts struct {
 | 
				
			||||||
 | 
						Ctx    context.Context
 | 
				
			||||||
 | 
						Config *config.Config
 | 
				
			||||||
 | 
						Logger *pterm.Logger
 | 
				
			||||||
 | 
						Cache  *cache.Cache
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type utilsCtxKey uint8
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const UtilsKey utilsCtxKey = iota
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func AddToCtx(ctx context.Context, u *Utils) context.Context {
 | 
				
			||||||
 | 
						return context.WithValue(ctx, UtilsKey, u)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func MustFromCtx(ctx context.Context) *Utils {
 | 
				
			||||||
 | 
						utils, err := FromCtx(ctx)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							panic(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return utils
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func FromCtx(ctx context.Context) (*Utils, error) {
 | 
				
			||||||
 | 
						utils, avail := ctx.Value(UtilsKey).(*Utils)
 | 
				
			||||||
 | 
						if !avail {
 | 
				
			||||||
 | 
							return nil, errors.New("invalid util in context")
 | 
				
			||||||
 | 
						} else if utils == nil {
 | 
				
			||||||
 | 
							return nil, errors.New("util never set in context")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return utils, nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) Init(opts *UtilOpts) {
 | 
				
			||||||
 | 
						u.ctx = opts.Ctx
 | 
				
			||||||
 | 
						u.SetConfig(opts.Config)
 | 
				
			||||||
 | 
						u.SetLogger(opts.Logger)
 | 
				
			||||||
 | 
						u.SetCache(opts.Cache)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) SetCache(c *cache.Cache) {
 | 
				
			||||||
 | 
						if c == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						u.Lock()
 | 
				
			||||||
 | 
						defer u.Unlock()
 | 
				
			||||||
 | 
						u.cache = c
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) Cache() *cache.Cache {
 | 
				
			||||||
 | 
						u.RLock()
 | 
				
			||||||
 | 
						defer u.RUnlock()
 | 
				
			||||||
 | 
						return u.cache
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) SetLogger(l *pterm.Logger) {
 | 
				
			||||||
 | 
						if l == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						u.Lock()
 | 
				
			||||||
 | 
						defer u.Unlock()
 | 
				
			||||||
 | 
						u.logger = l
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) Logger() *pterm.Logger {
 | 
				
			||||||
 | 
						u.RLock()
 | 
				
			||||||
 | 
						defer u.RUnlock()
 | 
				
			||||||
 | 
						return u.logger
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) SetConfig(conf *config.Config) {
 | 
				
			||||||
 | 
						if conf == nil {
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						u.Lock()
 | 
				
			||||||
 | 
						defer u.Unlock()
 | 
				
			||||||
 | 
						u.config = conf
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) Config() *config.Config {
 | 
				
			||||||
 | 
						u.RLock()
 | 
				
			||||||
 | 
						defer u.RUnlock()
 | 
				
			||||||
 | 
						return u.config
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) SetContext(c context.Context) {
 | 
				
			||||||
 | 
						u.Lock()
 | 
				
			||||||
 | 
						defer u.Unlock()
 | 
				
			||||||
 | 
						u.ctx = c
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) Context() context.Context {
 | 
				
			||||||
 | 
						u.RLock()
 | 
				
			||||||
 | 
						defer u.RUnlock()
 | 
				
			||||||
 | 
						return u.ctx
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										74
									
								
								cmd/util/util_completion.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								cmd/util/util_completion.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,74 @@
 | 
				
			|||||||
 | 
					package util
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"strconv"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ValidProjectsFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
				
			||||||
 | 
						[]string, cobra.ShellCompDirective,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
						u := MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						u.InitProjectCache(cmd, args)
 | 
				
			||||||
 | 
						return u.Cache().ProjectStrings(toComplete), cobra.ShellCompDirectiveNoFileComp
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ValidAliasesFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
				
			||||||
 | 
						[]string, cobra.ShellCompDirective,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
						utils := MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						utils.InitProjectCache(cmd, args)
 | 
				
			||||||
 | 
						return utils.Cache().AliasStrings(toComplete), cobra.ShellCompDirectiveNoFileComp
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) ValidProjectsOrAliasesFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
				
			||||||
 | 
						[]string, cobra.ShellCompDirective,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
						projectStrings, _ := ValidAliasesFunc(cmd, args, toComplete)
 | 
				
			||||||
 | 
						aliasStrings, _ := ValidProjectsFunc(cmd, args, toComplete)
 | 
				
			||||||
 | 
						return append(projectStrings, aliasStrings...), cobra.ShellCompDirectiveDefault
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ValidRemotesFunc(cmd *cobra.Command, _ []string, toComplete string) (
 | 
				
			||||||
 | 
						[]string, cobra.ShellCompDirective,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
						u := MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						remotes := make([]string, 0, len(u.Config().Remotes))
 | 
				
			||||||
 | 
						for _, remote := range u.Config().Remotes {
 | 
				
			||||||
 | 
							if strings.HasPrefix(remote.Host, toComplete) {
 | 
				
			||||||
 | 
								remotes = append(remotes, remote.Host)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return remotes, cobra.ShellCompDirectiveNoFileComp
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ValidLogLevelsFunc(_ *cobra.Command, _ []string, toComplete string) (
 | 
				
			||||||
 | 
						[]string, cobra.ShellCompDirective,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
						levels := []string{"info", "warn", "error", "debug"}
 | 
				
			||||||
 | 
						matchingLevels := make([]string, 0, len(levels))
 | 
				
			||||||
 | 
						for _, level := range levels {
 | 
				
			||||||
 | 
							if strings.HasPrefix(level, toComplete) {
 | 
				
			||||||
 | 
								matchingLevels = append(matchingLevels, level)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return matchingLevels, cobra.ShellCompDirectiveNoFileComp
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ValidProjectIdFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
				
			||||||
 | 
						[]string, cobra.ShellCompDirective,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
 | 
						u := MustFromCtx(cmd.Context())
 | 
				
			||||||
 | 
						u.InitProjectCache(cmd, args)
 | 
				
			||||||
 | 
						matchingIds := make([]string, 0, len(u.Cache().Projects))
 | 
				
			||||||
 | 
						for _, p := range u.Cache().Projects {
 | 
				
			||||||
 | 
							idString := strconv.FormatInt(int64(p.ID), 10)
 | 
				
			||||||
 | 
							if strings.HasPrefix(idString, toComplete) {
 | 
				
			||||||
 | 
								matchingIds = append(matchingIds, idString)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return slices.Clip(matchingIds), cobra.ShellCompDirectiveNoFileComp
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										86
									
								
								cmd/util/util_constants.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								cmd/util/util_constants.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,86 @@
 | 
				
			|||||||
 | 
					package util
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const (
 | 
				
			||||||
 | 
						// Cobra Flags
 | 
				
			||||||
 | 
						FlagRemote     = "remote"
 | 
				
			||||||
 | 
						FlagConfig     = "config"
 | 
				
			||||||
 | 
						FlagPath       = "projectPath"
 | 
				
			||||||
 | 
						FlagLogLevel   = "logLevel"
 | 
				
			||||||
 | 
						FlagProjectID  = "projectID"
 | 
				
			||||||
 | 
						FlagCacheForce = "force"
 | 
				
			||||||
 | 
						FlagOwnerOnly  = "ownerOnly"
 | 
				
			||||||
 | 
						FlagAll        = "all"
 | 
				
			||||||
 | 
						FlagCurrent    = "current"
 | 
				
			||||||
 | 
						FlagPrompt     = "prompt"
 | 
				
			||||||
 | 
						FlagWrite      = "write"
 | 
				
			||||||
 | 
						FlagSensitive  = "sensitive"
 | 
				
			||||||
 | 
						FlagDocsPath   = "docsPath"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Viper config bindings
 | 
				
			||||||
 | 
						ViperAliasAddPID        = "alias.add.projectID"
 | 
				
			||||||
 | 
						ViperCacheUnlockForce   = "cache.unlock.force"
 | 
				
			||||||
 | 
						ViperCacheLoadOwnerOnly = "cache.load.ownerOnly"
 | 
				
			||||||
 | 
						ViperProjectListAll     = "project.list.all"
 | 
				
			||||||
 | 
						ViperProjectShowCurrent = "project.show.current"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const (
 | 
				
			||||||
 | 
						DefGitlabHost    = "https://gitlab.com"
 | 
				
			||||||
 | 
						DefLogLevel      = "info"
 | 
				
			||||||
 | 
						DefConfigPath    = "~/.config/git-project-manager.yaml"
 | 
				
			||||||
 | 
						ConfigName       = "git-project-manager"
 | 
				
			||||||
 | 
						LegacyConfigName = "gitlab-project-manager"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const AliasCmdLong = `Manages project aliases, with options for
 | 
				
			||||||
 | 
					listing, adding, and deleting.`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const AliasListCmdLong = `Lists all aliases by project`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const AliasAddCmdLong = `Adds a project alias to a project
 | 
				
			||||||
 | 
					project ID can be provided, or will otherwise use fuzzy find`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const AliasDeleteCmdLong = `Deletes aliases from projects
 | 
				
			||||||
 | 
					project ID can be provided, or will otherwise use fuzzy find`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const CacheCmdLong = `Contains sub-commands for managing project cache.
 | 
				
			||||||
 | 
					The project cache keeps this speedy, without smashing against the Git
 | 
				
			||||||
 | 
					API every time a new project is added / searched for`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const RootCmdLong = `Finds Git projects using fuzzy-find, remembering
 | 
				
			||||||
 | 
					your chosen term for the project as an alias, and offers helpful
 | 
				
			||||||
 | 
					shortcuts for moving around in projects and opening your code`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjCmdLong = `Switches to a Git project by name or alias
 | 
				
			||||||
 | 
					If not found, will enter fzf mode. If not cloned, will clone
 | 
				
			||||||
 | 
					the project locally.`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjGoCmdLong = `Go to a project, searching by alias
 | 
				
			||||||
 | 
					If project is not already cloned, its path will be built and it
 | 
				
			||||||
 | 
					will be cloned from source control.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If conf.projects.alwaysPull, a git pull will be ran automatically`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjRunCmdLong = `Runs the current project. Tries to detect
 | 
				
			||||||
 | 
					the language and runs accordingly (e.g. go run .)`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjListCmdLong = `List locally cloned projects. Optionally
 | 
				
			||||||
 | 
					lists all projects in project cache`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjAddCmdLong = `Adds a new project to the local project path
 | 
				
			||||||
 | 
					uses fuzzy find to locate the project`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjShowCmdLong = `Shows detail for a particular project
 | 
				
			||||||
 | 
					Will always fuzzy find`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ProjOpenCmdLong = `Opens the given project directory in the editor
 | 
				
			||||||
 | 
					of your choice. Will find certain well-known entrypoints (e.g. main.go).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If your editor is set in your config file, it will be used, otherwise
 | 
				
			||||||
 | 
					one will be found in your path from a list of known defaults.`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ConfigCmdLong = `Commands for managing configuration, particulary
 | 
				
			||||||
 | 
					useful for seeding a new config file`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const ConfigGenCmdLong = `Produces yaml to stdout that can be used
 | 
				
			||||||
 | 
					to seed the configuration file`
 | 
				
			||||||
@@ -1,15 +1,16 @@
 | 
				
			|||||||
package cmd
 | 
					package util
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"context"
 | 
						"context"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fzf "github.com/ktr0731/go-fuzzyfinder"
 | 
						fzf "github.com/ktr0731/go-fuzzyfinder"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/cache"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type fzfProjectOpts struct {
 | 
					type FzfProjectOpts struct {
 | 
				
			||||||
	Ctx           context.Context
 | 
						Ctx           context.Context
 | 
				
			||||||
	Search        string
 | 
						Search        string
 | 
				
			||||||
	MustHaveAlias bool
 | 
						MustHaveAlias bool
 | 
				
			||||||
@@ -18,14 +19,14 @@ type fzfProjectOpts struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// This will try to find a project by alias if a search term
 | 
					// This will try to find a project by alias if a search term
 | 
				
			||||||
// is given, otherwise will fuzzy find by project
 | 
					// is given, otherwise will fuzzy find by project
 | 
				
			||||||
func fzfFindProject(opts *fzfProjectOpts) *projects.Project {
 | 
					func (u *Utils) FzfFindProject(opts *FzfProjectOpts) *projects.Project {
 | 
				
			||||||
	var project *projects.Project
 | 
						var project *projects.Project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if opts.Search != "" {
 | 
						if opts.Search != "" {
 | 
				
			||||||
		project = fzfSearchProjectAliases(opts)
 | 
							project = u.FzfSearchProjectAliases(opts)
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		var err error
 | 
							var err error
 | 
				
			||||||
		project, err = fzfProject(opts)
 | 
							project, err = u.FzfProject(opts)
 | 
				
			||||||
		if project == nil || err != nil {
 | 
							if project == nil || err != nil {
 | 
				
			||||||
			return nil
 | 
								return nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
@@ -37,35 +38,35 @@ func fzfFindProject(opts *fzfProjectOpts) *projects.Project {
 | 
				
			|||||||
// If . is given as a project, will open project from the
 | 
					// If . is given as a project, will open project from the
 | 
				
			||||||
// current working directory. Otherwise, will attempt to fuzzy-find
 | 
					// current working directory. Otherwise, will attempt to fuzzy-find
 | 
				
			||||||
// a project given a search term if provided
 | 
					// a project given a search term if provided
 | 
				
			||||||
func fzfCwdOrSearchProjectAliases(opts *fzfProjectOpts) *projects.Project {
 | 
					func (u *Utils) FzfCwdOrSearchProjectAliases(opts *FzfProjectOpts) *projects.Project {
 | 
				
			||||||
	var project *projects.Project
 | 
						var project *projects.Project
 | 
				
			||||||
	if opts.Search == "." {
 | 
						if opts.Search == "." {
 | 
				
			||||||
		project, _ = projectCache.GetProjectFromCwd()
 | 
							project, _ = u.Cache().GetProjectFromCwd()
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		project = fzfSearchProjectAliases(opts)
 | 
							project = u.FzfSearchProjectAliases(opts)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return project
 | 
						return project
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// This will fuzzy search only aliases, preferring an exact
 | 
					// This will fuzzy search only aliases, preferring an exact
 | 
				
			||||||
// match if one is given
 | 
					// match if one is given
 | 
				
			||||||
func fzfSearchProjectAliases(opts *fzfProjectOpts) *projects.Project {
 | 
					func (u *Utils) FzfSearchProjectAliases(opts *FzfProjectOpts) *projects.Project {
 | 
				
			||||||
	var project *projects.Project
 | 
						var project *projects.Project
 | 
				
			||||||
	var alias *cache.ProjectAlias
 | 
						var alias *cache.ProjectAlias
 | 
				
			||||||
	if alias = projectCache.GetAliasByName(opts.Search, opts.Remotes...); alias != nil {
 | 
						if alias = u.Cache().GetAliasByName(opts.Search, opts.Remotes...); alias != nil {
 | 
				
			||||||
		project = projectCache.GetProjectByAlias(alias)
 | 
							project = u.Cache().GetProjectByAlias(alias)
 | 
				
			||||||
		plog.Info("Perfect alias match... flawless")
 | 
							u.Logger().Info("Perfect alias match... flawless")
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		// Get fuzzy if we don't have an exact match
 | 
							// Get fuzzy if we don't have an exact match
 | 
				
			||||||
		aliases := projectCache.FuzzyFindAlias(opts.Search)
 | 
							aliases := u.Cache().FuzzyFindAlias(opts.Search)
 | 
				
			||||||
		if len(aliases) > 1 {
 | 
							if len(aliases) > 1 {
 | 
				
			||||||
			// If multiple aliases were found, switch over to project
 | 
								// If multiple aliases were found, switch over to project
 | 
				
			||||||
			// by alias mode with merging
 | 
								// by alias mode with merging
 | 
				
			||||||
			// alias = fzfAliasFromAliases(rootCmd.Context(), aliases)
 | 
								// alias = fzfAliasFromAliases(rootCmd.Context(), aliases)
 | 
				
			||||||
			project, _ = fzfProjectFromAliases(opts, aliases)
 | 
								project, _ = u.FzfProjectFromAliases(opts, aliases)
 | 
				
			||||||
		} else if len(aliases) == 1 {
 | 
							} else if len(aliases) == 1 {
 | 
				
			||||||
			alias = aliases[0]
 | 
								alias = aliases[0]
 | 
				
			||||||
			project = projectCache.GetProjectByAlias(alias)
 | 
								project = u.Cache().GetProjectByAlias(alias)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return project
 | 
						return project
 | 
				
			||||||
@@ -75,18 +76,18 @@ func fzfSearchProjectAliases(opts *fzfProjectOpts) *projects.Project {
 | 
				
			|||||||
// a single one. Replaced by fzfProjectFromAliases in fzfSearchProjectAliases
 | 
					// a single one. Replaced by fzfProjectFromAliases in fzfSearchProjectAliases
 | 
				
			||||||
// as merging is preferred, but can be used if it's ever desirable to
 | 
					// as merging is preferred, but can be used if it's ever desirable to
 | 
				
			||||||
// return a single alias from all aliases
 | 
					// return a single alias from all aliases
 | 
				
			||||||
func fzfAliasFromAliases(opts *fzfProjectOpts, aliases []*cache.ProjectAlias) *cache.ProjectAlias {
 | 
					func (u *Utils) FzfAliasFromAliases(opts *FzfProjectOpts, aliases []*cache.ProjectAlias) *cache.ProjectAlias {
 | 
				
			||||||
	var alias *cache.ProjectAlias
 | 
						var alias *cache.ProjectAlias
 | 
				
			||||||
	i, err := fzf.Find(
 | 
						i, err := fzf.Find(
 | 
				
			||||||
		aliases,
 | 
							aliases,
 | 
				
			||||||
		func(i int) string {
 | 
							func(i int) string {
 | 
				
			||||||
			return aliases[i].Alias + " -> " + projectCache.GetProjectByAlias(aliases[i]).PathWithNamespace
 | 
								return aliases[i].Alias + " -> " + u.Cache().GetProjectByAlias(aliases[i]).PathWithNamespace
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		fzf.WithContext(opts.Ctx),
 | 
							fzf.WithContext(opts.Ctx),
 | 
				
			||||||
		fzf.WithHeader("Choose an Alias"),
 | 
							fzf.WithHeader("Choose an Alias"),
 | 
				
			||||||
	)
 | 
						)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		plog.Error("Failed to fzf alias slice", plog.Args("error", err))
 | 
							u.Logger().Error("Failed to fzf alias slice", u.Logger().Args("error", err))
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		alias = aliases[i]
 | 
							alias = aliases[i]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -95,57 +96,55 @@ func fzfAliasFromAliases(opts *fzfProjectOpts, aliases []*cache.ProjectAlias) *c
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Given a list of aliases, merge them together and use the resulting
 | 
					// Given a list of aliases, merge them together and use the resulting
 | 
				
			||||||
// list of projects to return a project
 | 
					// list of projects to return a project
 | 
				
			||||||
func fzfProjectFromAliases(opts *fzfProjectOpts, aliases []*cache.ProjectAlias) (
 | 
					func (u *Utils) FzfProjectFromAliases(opts *FzfProjectOpts, aliases []*cache.ProjectAlias) (
 | 
				
			||||||
	*projects.Project, error) {
 | 
						*projects.Project, error,
 | 
				
			||||||
	mergedProjects := projectsFromAliases(aliases)
 | 
					) {
 | 
				
			||||||
 | 
						mergedProjects := u.projectsFromAliases(aliases)
 | 
				
			||||||
	if len(mergedProjects) == 1 {
 | 
						if len(mergedProjects) == 1 {
 | 
				
			||||||
		return mergedProjects[0], nil
 | 
							return mergedProjects[0], nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return fzfProjectFromProjects(opts, mergedProjects)
 | 
						return u.FzfProjectFromProjects(opts, mergedProjects)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func projectsFromAliases(aliases []*cache.ProjectAlias) []*projects.Project {
 | 
					func (u *Utils) projectsFromAliases(aliases []*cache.ProjectAlias) []*projects.Project {
 | 
				
			||||||
	projects := make([]*projects.Project, 0)
 | 
						projects := make([]*projects.Project, 0, len(aliases))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ALIASES:
 | 
					 | 
				
			||||||
	for _, a := range aliases {
 | 
						for _, a := range aliases {
 | 
				
			||||||
		for _, p := range projects {
 | 
							project := u.Cache().GetProjectByAlias(a)
 | 
				
			||||||
			// Already have it
 | 
							if project != nil && !slices.Contains(projects, project) {
 | 
				
			||||||
			if a.ProjectID == p.ID && a.Remote == p.Remote {
 | 
								projects = append(projects, project)
 | 
				
			||||||
				continue ALIASES
 | 
					 | 
				
			||||||
			}
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		projects = append(projects, projectCache.GetProjectByAlias(a))
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return projects
 | 
						return slices.Clip(projects)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// If opts.MustHaveAlias, will only allow selection of projects
 | 
					// If opts.MustHaveAlias, will only allow selection of projects
 | 
				
			||||||
// that have at least one alias defined
 | 
					// that have at least one alias defined
 | 
				
			||||||
func fzfProject(opts *fzfProjectOpts) (*projects.Project, error) {
 | 
					func (u *Utils) FzfProject(opts *FzfProjectOpts) (*projects.Project, error) {
 | 
				
			||||||
	var searchableProjects []*projects.Project
 | 
						var searchableProjects []*projects.Project
 | 
				
			||||||
	if opts.MustHaveAlias {
 | 
						if opts.MustHaveAlias {
 | 
				
			||||||
		searchableProjects = projectCache.GetProjectsWithAliases()
 | 
							searchableProjects = u.Cache().GetProjectsWithAliases()
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		searchableProjects = projectCache.Projects
 | 
							searchableProjects = u.Cache().Projects
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	// Filter out unwanted remotes if provided
 | 
						// Filter out unwanted remotes if provided
 | 
				
			||||||
	searchableProjects = filterProjectsWithRemotes(searchableProjects, opts.Remotes...)
 | 
						searchableProjects = u.FilterProjectsWithRemotes(searchableProjects, opts.Remotes...)
 | 
				
			||||||
	return fzfProjectFromProjects(opts, searchableProjects)
 | 
						return u.FzfProjectFromProjects(opts, searchableProjects)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Takes a list of projects and performs a fuzzyfind
 | 
					// Takes a list of projects and performs a fuzzyfind
 | 
				
			||||||
func fzfProjectFromProjects(opts *fzfProjectOpts, projects []*projects.Project) (
 | 
					func (u *Utils) FzfProjectFromProjects(opts *FzfProjectOpts, projects []*projects.Project) (
 | 
				
			||||||
	*projects.Project, error) {
 | 
						*projects.Project, error,
 | 
				
			||||||
 | 
					) {
 | 
				
			||||||
	i, err := fzf.Find(projects,
 | 
						i, err := fzf.Find(projects,
 | 
				
			||||||
		func(i int) string {
 | 
							func(i int) string {
 | 
				
			||||||
			// Display the project along with its aliases
 | 
								// Display the project along with its aliases
 | 
				
			||||||
			return projectCache.GetProjectStringWithAliases(projects[i])
 | 
								return u.Cache().GetProjectStringWithAliases(projects[i])
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		fzf.WithPreviewWindow(
 | 
							fzf.WithPreviewWindow(
 | 
				
			||||||
			func(i, width, height int) string {
 | 
								func(i, width, height int) string {
 | 
				
			||||||
				return projectCache.ProjectString(projects[i])
 | 
									return u.Cache().ProjectString(projects[i])
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
		),
 | 
							),
 | 
				
			||||||
		fzf.WithContext(opts.Ctx),
 | 
							fzf.WithContext(opts.Ctx),
 | 
				
			||||||
@@ -157,12 +156,12 @@ func fzfProjectFromProjects(opts *fzfProjectOpts, projects []*projects.Project)
 | 
				
			|||||||
	return projects[i], nil
 | 
						return projects[i], nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func fzfPreviewWindow(i, w, h int) string {
 | 
					func (u *Utils) FzfPreviewWindow(i, _, _ int) string {
 | 
				
			||||||
	p := projectCache.Projects[i]
 | 
						p := u.Cache().Projects[i]
 | 
				
			||||||
	return projectCache.ProjectString(p)
 | 
						return u.Cache().ProjectString(p)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func filterProjectsWithRemotes(gitProjects []*projects.Project, remotes ...string) []*projects.Project {
 | 
					func (u *Utils) FilterProjectsWithRemotes(gitProjects []*projects.Project, remotes ...string) []*projects.Project {
 | 
				
			||||||
	filteredProjects := make([]*projects.Project, 0, len(gitProjects))
 | 
						filteredProjects := make([]*projects.Project, 0, len(gitProjects))
 | 
				
			||||||
	if len(remotes) > 0 {
 | 
						if len(remotes) > 0 {
 | 
				
			||||||
		for _, p := range gitProjects {
 | 
							for _, p := range gitProjects {
 | 
				
			||||||
@@ -178,7 +177,7 @@ func filterProjectsWithRemotes(gitProjects []*projects.Project, remotes ...strin
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Nearly useless function that simply returns either an
 | 
					// Nearly useless function that simply returns either an
 | 
				
			||||||
// empty string, or a string from the first arg if one is provided
 | 
					// empty string, or a string from the first arg if one is provided
 | 
				
			||||||
func searchStringFromArgs(args []string) string {
 | 
					func (u *Utils) SearchStringFromArgs(args []string) string {
 | 
				
			||||||
	var term string
 | 
						var term string
 | 
				
			||||||
	if len(args) > 0 {
 | 
						if len(args) > 0 {
 | 
				
			||||||
		term = args[0]
 | 
							term = args[0]
 | 
				
			||||||
							
								
								
									
										163
									
								
								cmd/util/util_init.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										163
									
								
								cmd/util/util_init.go
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,163 @@
 | 
				
			|||||||
 | 
					// This file contains init methods that may be used by
 | 
				
			||||||
 | 
					// multiple sub-commands. For instance, the cach and projects
 | 
				
			||||||
 | 
					// sub-commands both depend on a cache and may both call the initProjectCache
 | 
				
			||||||
 | 
					// func (u *Util) from their PersistentPreRun commands
 | 
				
			||||||
 | 
					package util
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"os"
 | 
				
			||||||
 | 
						"os/user"
 | 
				
			||||||
 | 
						"path/filepath"
 | 
				
			||||||
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
 | 
						"github.com/spf13/cobra"
 | 
				
			||||||
 | 
						"golang.org/x/sys/unix"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/cache"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes"
 | 
				
			||||||
 | 
						gitearemote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/gitea"
 | 
				
			||||||
 | 
						githubremote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/github"
 | 
				
			||||||
 | 
						gitlabremote "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/gitlab"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func InitProjects(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils, _ := FromCtx(cmd.Context())
 | 
				
			||||||
 | 
						utils.InitProjectCache(cmd, args)
 | 
				
			||||||
 | 
						utils.mustHaveProjects(cmd, args)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) mustHaveProjects(cmd *cobra.Command, _ []string) {
 | 
				
			||||||
 | 
						if len(u.Cache().Projects) == 0 {
 | 
				
			||||||
 | 
							u.Logger().Fatal("No projects to " + cmd.Name() + ", try running cache load")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) InitProjectCache(cmd *cobra.Command, _ []string) {
 | 
				
			||||||
 | 
						var err error
 | 
				
			||||||
 | 
						u.Logger().Debug("Running pre-run for cacheCmd")
 | 
				
			||||||
 | 
						u.Config().Cache.File = u.Config().ProjectPath + "/.cache.yaml"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						gitRemotes := remotes.NewRemotes()
 | 
				
			||||||
 | 
						gitRemotes.AddRemotes(*u.GetRemotes(cmd)...)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						cacheOpts := &cache.CacheOpts{
 | 
				
			||||||
 | 
							ProjectsPath: u.Config().ProjectPath,
 | 
				
			||||||
 | 
							Path:         u.Config().Cache.File,
 | 
				
			||||||
 | 
							TTL:          u.Config().Cache.Ttl,
 | 
				
			||||||
 | 
							Logger:       u.Logger(),
 | 
				
			||||||
 | 
							Remotes:      gitRemotes,
 | 
				
			||||||
 | 
							Config:       u.Config(),
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						projectCache, err := cache.NewProjectCache(cacheOpts)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							u.Logger().Error("Failed to prepare project cache", u.Logger().Args("error", err))
 | 
				
			||||||
 | 
							os.Exit(1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						u.SetCache(projectCache)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if err := u.Cache().Read(); err != nil {
 | 
				
			||||||
 | 
							u.Logger().Error("Cache load failed", u.Logger().Args("error", err))
 | 
				
			||||||
 | 
							os.Exit(1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						u.Logger().Debug("Remotes Loaded", u.Logger().Args("remotes", cacheOpts.Remotes))
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Generically loads remotes from info.RemoteInfo in config.Remotes
 | 
				
			||||||
 | 
					func (u *Utils) GetRemotes(cmd *cobra.Command) *remotes.Remotes {
 | 
				
			||||||
 | 
						gitRemotes := new(remotes.Remotes)
 | 
				
			||||||
 | 
						*gitRemotes = make([]remote.Remote, 0)
 | 
				
			||||||
 | 
						for _, r := range u.Config().Remotes {
 | 
				
			||||||
 | 
							// Create a copy, set context
 | 
				
			||||||
 | 
							gitRemoteInfo := r
 | 
				
			||||||
 | 
							gitRemoteInfo.SetContext(cmd.Context())
 | 
				
			||||||
 | 
							var gitRemote remote.Remote
 | 
				
			||||||
 | 
							var err error
 | 
				
			||||||
 | 
							switch r.Type {
 | 
				
			||||||
 | 
							case "gitlab":
 | 
				
			||||||
 | 
								gitRemote, err = gitlabremote.NewGitlabRemote(&gitRemoteInfo)
 | 
				
			||||||
 | 
							case "gitea":
 | 
				
			||||||
 | 
								gitRemote, err = gitearemote.NewGiteaRemote(&gitRemoteInfo)
 | 
				
			||||||
 | 
							case "github":
 | 
				
			||||||
 | 
								gitRemote, err = githubremote.NewGithubRemote(&gitRemoteInfo)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							if err != nil {
 | 
				
			||||||
 | 
								u.Logger().Error("Failed to prepare remote", u.Logger().Args(
 | 
				
			||||||
 | 
									"error", err,
 | 
				
			||||||
 | 
									"type", r.Type))
 | 
				
			||||||
 | 
							} else {
 | 
				
			||||||
 | 
								*gitRemotes = append(*gitRemotes, gitRemote)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return gitRemotes
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func PostProjectCmd(cmd *cobra.Command, args []string) {
 | 
				
			||||||
 | 
						utils, _ := FromCtx(cmd.Context())
 | 
				
			||||||
 | 
						utils.PostProjectCache(cmd, args)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) PostProjectCache(_ *cobra.Command, _ []string) {
 | 
				
			||||||
 | 
						u.Cache().Write()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (u *Utils) InitProjectPath(_ *cobra.Command, _ []string) {
 | 
				
			||||||
 | 
						u.Logger().Debug("Running persistent pre-run for rootCmd")
 | 
				
			||||||
 | 
						var err error
 | 
				
			||||||
 | 
						if u.Config().ProjectPath == "" {
 | 
				
			||||||
 | 
							u.Config().ProjectPath = config.DefaultConfig.ProjectPath
 | 
				
			||||||
 | 
							return
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if u.Config().ProjectPath, err = ResolvePath(u.Config().ProjectPath); err != nil {
 | 
				
			||||||
 | 
							u.Logger().Error("Failed to determine project path", u.Logger().Args("error", err))
 | 
				
			||||||
 | 
							os.Exit(1)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						_, err = os.Stat(u.Config().ProjectPath)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							u.Logger().Error("Failed to stat project path, trying to create", u.Logger().Args("error", err))
 | 
				
			||||||
 | 
							if err = os.MkdirAll(u.Config().ProjectPath, 0o750); err != nil {
 | 
				
			||||||
 | 
								u.Logger().Error("Failed to create project path", u.Logger().Args("error", err))
 | 
				
			||||||
 | 
								os.Exit(1)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							u.Logger().Info("Project path created", u.Logger().Args("path", u.Config().ProjectPath))
 | 
				
			||||||
 | 
						} else {
 | 
				
			||||||
 | 
							if err = unix.Access(u.Config().ProjectPath, unix.W_OK); err != nil {
 | 
				
			||||||
 | 
								u.Logger().Error("Unable to write to project path", u.Logger().Args(
 | 
				
			||||||
 | 
									"path", u.Config().ProjectPath,
 | 
				
			||||||
 | 
									"error", err))
 | 
				
			||||||
 | 
								os.Exit(1)
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func ResolvePath(path string) (string, error) {
 | 
				
			||||||
 | 
						if strings.HasPrefix(path, "~/") {
 | 
				
			||||||
 | 
							usr, _ := user.Current()
 | 
				
			||||||
 | 
							path = filepath.Join(usr.HomeDir, path[2:])
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return filepath.Abs(path)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func GetConfigName(configPath string) string {
 | 
				
			||||||
 | 
						// Check existing config
 | 
				
			||||||
 | 
						for _, ext := range []string{"yml", "yaml"} {
 | 
				
			||||||
 | 
							configFile := fmt.Sprintf("%s/%s.%s", configPath, ConfigName, ext)
 | 
				
			||||||
 | 
							legacyConfigFile := fmt.Sprintf("%s/%s.%s", configPath, LegacyConfigName, ext)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if _, err := os.Stat(configFile); err == nil {
 | 
				
			||||||
 | 
								return ConfigName
 | 
				
			||||||
 | 
							} else if _, err := os.Stat(legacyConfigFile); err == nil {
 | 
				
			||||||
 | 
								pterm.DefaultLogger.WithWriter(os.Stderr).
 | 
				
			||||||
 | 
									Warn(fmt.Sprintf("using legacy config path, suggest using %s/%s.yaml", configPath, ConfigName))
 | 
				
			||||||
 | 
								return LegacyConfigName
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Nothing found, do what we want
 | 
				
			||||||
 | 
						return ConfigName
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -1,64 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"strconv"
 | 
					 | 
				
			||||||
	"strings"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func validProjectsFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
					 | 
				
			||||||
	[]string, cobra.ShellCompDirective) {
 | 
					 | 
				
			||||||
	initProjectCache(cmd, args)
 | 
					 | 
				
			||||||
	return projectCache.ProjectStrings(toComplete), cobra.ShellCompDirectiveNoFileComp
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func validAliasesFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
					 | 
				
			||||||
	[]string, cobra.ShellCompDirective) {
 | 
					 | 
				
			||||||
	initProjectCache(cmd, args)
 | 
					 | 
				
			||||||
	return projectCache.AliasStrings(toComplete), cobra.ShellCompDirectiveNoFileComp
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func validProjectsOrAliasesFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
					 | 
				
			||||||
	[]string, cobra.ShellCompDirective) {
 | 
					 | 
				
			||||||
	projectStrings, _ := validAliasesFunc(cmd, args, toComplete)
 | 
					 | 
				
			||||||
	aliasStrings, _ := validProjectsFunc(cmd, args, toComplete)
 | 
					 | 
				
			||||||
	return append(projectStrings, aliasStrings...), cobra.ShellCompDirectiveDefault
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func validRemotesFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
					 | 
				
			||||||
	[]string, cobra.ShellCompDirective) {
 | 
					 | 
				
			||||||
	remotes := make([]string, 0, len(conf.Remotes))
 | 
					 | 
				
			||||||
	for _, remote := range conf.Remotes {
 | 
					 | 
				
			||||||
		if strings.HasPrefix(remote.Host, toComplete) {
 | 
					 | 
				
			||||||
			remotes = append(remotes, remote.Host)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return remotes, cobra.ShellCompDirectiveNoFileComp
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func validLogLevelsFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
					 | 
				
			||||||
	[]string, cobra.ShellCompDirective) {
 | 
					 | 
				
			||||||
	levels := []string{"info", "warn", "error", "debug"}
 | 
					 | 
				
			||||||
	matchingLevels := make([]string, 0, len(levels))
 | 
					 | 
				
			||||||
	for _, level := range levels {
 | 
					 | 
				
			||||||
		if strings.HasPrefix(level, toComplete) {
 | 
					 | 
				
			||||||
			matchingLevels = append(matchingLevels, level)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return matchingLevels, cobra.ShellCompDirectiveNoFileComp
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func validProjectIdFunc(cmd *cobra.Command, args []string, toComplete string) (
 | 
					 | 
				
			||||||
	[]string, cobra.ShellCompDirective) {
 | 
					 | 
				
			||||||
	initProjectCache(cmd, args)
 | 
					 | 
				
			||||||
	matchingIds := make([]string, 0, len(projectCache.Projects))
 | 
					 | 
				
			||||||
	for _, p := range projectCache.Projects {
 | 
					 | 
				
			||||||
		idString := strconv.FormatInt(int64(p.ID), 10)
 | 
					 | 
				
			||||||
		if strings.HasPrefix(idString, toComplete) {
 | 
					 | 
				
			||||||
			matchingIds = append(matchingIds, idString)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return slices.Clip(matchingIds), cobra.ShellCompDirectiveNoFileComp
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,60 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const (
 | 
					 | 
				
			||||||
	defGitlabHost = "https://gitlab.com"
 | 
					 | 
				
			||||||
	defLogLevel   = "info"
 | 
					 | 
				
			||||||
	defConfigPath = "~/.config/gitlab-project-manager.yaml"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const aliasCmdLong = `Manages project aliases, with options for
 | 
					 | 
				
			||||||
listing, adding, and deleting.`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const aliasListCmdLong = `Lists all aliases by project`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const aliasAddCmdLong = `Adds a project alias to a project
 | 
					 | 
				
			||||||
project ID can be provided, or will otherwise use fuzzy find`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const aliasDeleteCmdLong = `Deletes aliases from projects
 | 
					 | 
				
			||||||
project ID can be provided, or will otherwise use fuzzy find`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const cacheCmdLong = `Contains sub-commands for managing project cache.
 | 
					 | 
				
			||||||
The project cache keeps this speedy, without smashing against the GitLab
 | 
					 | 
				
			||||||
API every time a new project is added / searched for`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const rootCmdLong = `Finds GitLab projects using fuzzy-find, remembering
 | 
					 | 
				
			||||||
your chosen term for the project as an alias, and offers helpful
 | 
					 | 
				
			||||||
shortcuts for moving around in projects and opening your code`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projCmdLong = `Switches to a GitLab project by name or alias
 | 
					 | 
				
			||||||
If not found, will enter fzf mode. If not cloned, will clone
 | 
					 | 
				
			||||||
the project locally.`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projGoCmdLong = `Go to a project, searching by alias
 | 
					 | 
				
			||||||
If project is not already cloned, its path will be built and it
 | 
					 | 
				
			||||||
will be cloned from source control.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
If conf.projects.alwaysPull, a git pull will be ran automatically`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projRunCmdLong = `Runs the current project. Tries to detect
 | 
					 | 
				
			||||||
the language and runs accordingly (e.g. go run .)`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projListCmdLong = `List locally cloned projects. Optionally
 | 
					 | 
				
			||||||
lists all projects in project cache`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projAddCmdLong = `Adds a new project to the local project path
 | 
					 | 
				
			||||||
uses fuzzy find to locate the project`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projShowCmdLong = `Shows detail for a particular project
 | 
					 | 
				
			||||||
Will always fuzzy find`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const projOpenCmdLong = `Opens the given project directory in the editor
 | 
					 | 
				
			||||||
of your choice. Will find certain well-known entrypoints (e.g. main.go).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
If your editor is set in your config file, it will be used, otherwise
 | 
					 | 
				
			||||||
one will be found in your path from a list of known defaults.`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const configCmdLong = `Commands for managing configuration, particulary
 | 
					 | 
				
			||||||
useful for seeding a new config file`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
const configGenCmdLong = `Produces yaml to stdout that can be used
 | 
					 | 
				
			||||||
to seed the configuration file`
 | 
					 | 
				
			||||||
							
								
								
									
										122
									
								
								cmd/util_init.go
									
									
									
									
									
								
							
							
						
						
									
										122
									
								
								cmd/util_init.go
									
									
									
									
									
								
							@@ -1,122 +0,0 @@
 | 
				
			|||||||
package cmd
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import (
 | 
					 | 
				
			||||||
	"os"
 | 
					 | 
				
			||||||
	"os/user"
 | 
					 | 
				
			||||||
	"path/filepath"
 | 
					 | 
				
			||||||
	"strings"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	"github.com/spf13/cobra"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/cache"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/config"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes"
 | 
					 | 
				
			||||||
	gitearemote "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/gitea"
 | 
					 | 
				
			||||||
	githubremote "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/github"
 | 
					 | 
				
			||||||
	gitlabremote "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/gitlab"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
					 | 
				
			||||||
	"golang.org/x/sys/unix"
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// This file contains init methods that may be used by
 | 
					 | 
				
			||||||
// multiple sub-commands. For instance, the cach and projects
 | 
					 | 
				
			||||||
// sub-commands both depend on a cache and may both call the initProjectCache
 | 
					 | 
				
			||||||
// func from their PersistentPreRun commands
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func initProjectCache(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	var err error
 | 
					 | 
				
			||||||
	plog.Debug("Running pre-run for cacheCmd")
 | 
					 | 
				
			||||||
	conf.Cache.File = conf.ProjectPath + "/.cache.yaml"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	gitRemotes := remotes.NewRemotes()
 | 
					 | 
				
			||||||
	gitRemotes.AddRemotes(*getRemotes(cmd)...)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	cacheOpts := &cache.CacheOpts{
 | 
					 | 
				
			||||||
		ProjectsPath: conf.ProjectPath,
 | 
					 | 
				
			||||||
		Path:         conf.Cache.File,
 | 
					 | 
				
			||||||
		TTL:          conf.Cache.Ttl,
 | 
					 | 
				
			||||||
		Logger:       plog,
 | 
					 | 
				
			||||||
		Remotes:      gitRemotes,
 | 
					 | 
				
			||||||
		Config:       &conf,
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if projectCache, err = cache.NewProjectCache(cacheOpts); err != nil {
 | 
					 | 
				
			||||||
		plog.Error("Failed to prepare project cache", plog.Args("error", err))
 | 
					 | 
				
			||||||
		os.Exit(1)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if err := projectCache.Read(); err != nil {
 | 
					 | 
				
			||||||
		plog.Error("Cache load failed", plog.Args("error", err))
 | 
					 | 
				
			||||||
		os.Exit(1)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	plog.Debug("Remotes Loaded", plog.Args("remotes", cacheOpts.Remotes))
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// Generically loads remotes from info.RemoteInfo in config.Remotes
 | 
					 | 
				
			||||||
func getRemotes(cmd *cobra.Command) *remotes.Remotes {
 | 
					 | 
				
			||||||
	gitRemotes := new(remotes.Remotes)
 | 
					 | 
				
			||||||
	*gitRemotes = make([]remote.Remote, 0)
 | 
					 | 
				
			||||||
	for _, r := range conf.Remotes {
 | 
					 | 
				
			||||||
		// Create a copy, set context
 | 
					 | 
				
			||||||
		gitRemoteInfo := r
 | 
					 | 
				
			||||||
		gitRemoteInfo.SetContext(cmd.Context())
 | 
					 | 
				
			||||||
		var gitRemote remote.Remote
 | 
					 | 
				
			||||||
		var err error
 | 
					 | 
				
			||||||
		switch r.Type {
 | 
					 | 
				
			||||||
		case "gitlab":
 | 
					 | 
				
			||||||
			gitRemote, err = gitlabremote.NewGitlabRemote(&gitRemoteInfo)
 | 
					 | 
				
			||||||
		case "gitea":
 | 
					 | 
				
			||||||
			gitRemote, err = gitearemote.NewGiteaRemote(&gitRemoteInfo)
 | 
					 | 
				
			||||||
		case "github":
 | 
					 | 
				
			||||||
			gitRemote, err = githubremote.NewGithubRemote(&gitRemoteInfo)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			plog.Error("Failed to prepare remote", plog.Args(
 | 
					 | 
				
			||||||
				"error", err,
 | 
					 | 
				
			||||||
				"type", r.Type))
 | 
					 | 
				
			||||||
		} else {
 | 
					 | 
				
			||||||
			*gitRemotes = append(*gitRemotes, gitRemote)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return gitRemotes
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func postProjectCache(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	projectCache.Write()
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func initProjectPath(cmd *cobra.Command, args []string) {
 | 
					 | 
				
			||||||
	plog.Debug("Running persistent pre-run for rootCmd")
 | 
					 | 
				
			||||||
	var err error
 | 
					 | 
				
			||||||
	if conf.ProjectPath == "" {
 | 
					 | 
				
			||||||
		conf.ProjectPath = config.DefaultConfig.ProjectPath
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if conf.ProjectPath, err = resolvePath(conf.ProjectPath); err != nil {
 | 
					 | 
				
			||||||
		plog.Error("Failed to determine project path", plog.Args("error", err))
 | 
					 | 
				
			||||||
		os.Exit(1)
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	_, err = os.Stat(conf.ProjectPath)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
					 | 
				
			||||||
		plog.Error("Failed to stat project path, trying to create", plog.Args("error", err))
 | 
					 | 
				
			||||||
		if err := os.MkdirAll(conf.ProjectPath, 0750); err != nil {
 | 
					 | 
				
			||||||
			plog.Error("Failed to create project path", plog.Args("error", err))
 | 
					 | 
				
			||||||
			os.Exit(1)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		plog.Info("Project path created", plog.Args("path", conf.ProjectPath))
 | 
					 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		if err = unix.Access(conf.ProjectPath, unix.W_OK); err != nil {
 | 
					 | 
				
			||||||
			plog.Error("Unable to write to project path", plog.Args(
 | 
					 | 
				
			||||||
				"path", conf.ProjectPath,
 | 
					 | 
				
			||||||
				"error", err))
 | 
					 | 
				
			||||||
			os.Exit(1)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func resolvePath(path string) (string, error) {
 | 
					 | 
				
			||||||
	if strings.HasPrefix(path, "~/") {
 | 
					 | 
				
			||||||
		usr, _ := user.Current()
 | 
					 | 
				
			||||||
		path = filepath.Join(usr.HomeDir, path[2:])
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return filepath.Abs(path)
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@@ -1,12 +1,12 @@
 | 
				
			|||||||
# Completion
 | 
					# Completion
 | 
				
			||||||
source <(gitlab-project-manager completion zsh)
 | 
					source <(git-project-manager completion zsh)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
alias gpm="gitlab-project-manager"
 | 
					alias gpm="git-project-manager"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Go to a project, specify a fzf filter or filter
 | 
					# Go to a project, specify a fzf filter or filter
 | 
				
			||||||
# through them all
 | 
					# through them all
 | 
				
			||||||
pgo () {
 | 
					pgo () {
 | 
				
			||||||
	project=` gitlab-project-manager project cd $1 `
 | 
						project=` git-project-manager project cd $1 `
 | 
				
			||||||
	if [ $? -eq 0 ]; then
 | 
						if [ $? -eq 0 ]; then
 | 
				
			||||||
		cd $project
 | 
							cd $project
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
@@ -14,20 +14,20 @@ pgo () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Add a new project to your local projects path
 | 
					# Add a new project to your local projects path
 | 
				
			||||||
padd () {
 | 
					padd () {
 | 
				
			||||||
	gitlab-project-manager project add
 | 
						git-project-manager project add
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
plist () {
 | 
					plist () {
 | 
				
			||||||
	gitlab-project-manager alias list
 | 
						git-project-manager alias list
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pshow () {
 | 
					pshow () {
 | 
				
			||||||
	gitlab-project-manager project show --current
 | 
						git-project-manager project show --current
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
popen () {
 | 
					popen () {
 | 
				
			||||||
	gitlab-project-manager project open $1
 | 
						git-project-manager project open $1
 | 
				
			||||||
	reset 2>&1 > /dev/null
 | 
						reset 2>&1 > /dev/null
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
alias prun="gitlab-project-manager project run"
 | 
					alias prun="git-project-manager project run"
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										30
									
								
								docs/git-project-manager.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								docs/git-project-manager.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,30 @@
 | 
				
			|||||||
 | 
					## git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Find and use Git projects locally
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Finds Git projects using fuzzy-find, remembering
 | 
				
			||||||
 | 
					your chosen term for the project as an alias, and offers helpful
 | 
				
			||||||
 | 
					shortcuts for moving around in projects and opening your code
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					  -h, --help                 help for git-project-manager
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager alias](git-project-manager_alias.md)	 - Manage project aliases
 | 
				
			||||||
 | 
					* [git-project-manager cache](git-project-manager_cache.md)	 - Manage Git project cache
 | 
				
			||||||
 | 
					* [git-project-manager completion](git-project-manager_completion.md)	 - Generate the autocompletion script for the specified shell
 | 
				
			||||||
 | 
					* [git-project-manager config](git-project-manager_config.md)	 - Git Project Manager Configuration
 | 
				
			||||||
 | 
					* [git-project-manager docs](git-project-manager_docs.md)	 - Generate documentation for git-project-manager
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										32
									
								
								docs/git-project-manager_alias.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								docs/git-project-manager_alias.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					## git-project-manager alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Manage project aliases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Manages project aliases, with options for
 | 
				
			||||||
 | 
					listing, adding, and deleting.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for alias
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager](git-project-manager.md)	 - Find and use Git projects locally
 | 
				
			||||||
 | 
					* [git-project-manager alias add](git-project-manager_alias_add.md)	 - Add a project alias
 | 
				
			||||||
 | 
					* [git-project-manager alias delete](git-project-manager_alias_delete.md)	 - Delete a project alias
 | 
				
			||||||
 | 
					* [git-project-manager alias list](git-project-manager_alias_list.md)	 - List Aliases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_alias_add.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_alias_add.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager alias add
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Add a project alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Adds a project alias to a project
 | 
				
			||||||
 | 
					project ID can be provided, or will otherwise use fuzzy find
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager alias add [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help            help for add
 | 
				
			||||||
 | 
					      --projectID int   Specify a project by ID
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager alias](git-project-manager_alias.md)	 - Manage project aliases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_alias_delete.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_alias_delete.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager alias delete
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Delete a project alias
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Deletes aliases from projects
 | 
				
			||||||
 | 
					project ID can be provided, or will otherwise use fuzzy find
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager alias delete [fuzzy project or alias] [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help            help for delete
 | 
				
			||||||
 | 
					      --projectID int   Specify a project by ID
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager alias](git-project-manager_alias.md)	 - Manage project aliases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										32
									
								
								docs/git-project-manager_alias_list.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								docs/git-project-manager_alias_list.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,32 @@
 | 
				
			|||||||
 | 
					## git-project-manager alias list
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					List Aliases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Lists all aliases by project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager alias list [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for list
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager alias](git-project-manager_alias.md)	 - Manage project aliases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										35
									
								
								docs/git-project-manager_cache.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								docs/git-project-manager_cache.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					## git-project-manager cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Manage Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Contains sub-commands for managing project cache.
 | 
				
			||||||
 | 
					The project cache keeps this speedy, without smashing against the Git
 | 
				
			||||||
 | 
					API every time a new project is added / searched for
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help           help for cache
 | 
				
			||||||
 | 
					      --ttl duration   Duration before cache is re-built in go time.Duration format (default 48h0m0s)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager](git-project-manager.md)	 - Find and use Git projects locally
 | 
				
			||||||
 | 
					* [git-project-manager cache clear](git-project-manager_cache_clear.md)	 - Clear Git Project Cache
 | 
				
			||||||
 | 
					* [git-project-manager cache dump](git-project-manager_cache_dump.md)	 - Dump Git project cache
 | 
				
			||||||
 | 
					* [git-project-manager cache load](git-project-manager_cache_load.md)	 - Load Git Project Cache
 | 
				
			||||||
 | 
					* [git-project-manager cache unlock](git-project-manager_cache_unlock.md)	 - unlock Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										36
									
								
								docs/git-project-manager_cache_clear.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								docs/git-project-manager_cache_clear.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					## git-project-manager cache clear
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Clear Git Project Cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Used to reset a project cache, forcing it to be rebuilt.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If --clearAliases is provided, will also reset aliases. Use with caution.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager cache clear [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --clearAliases   Will also clear aliases from the cache, use with caution
 | 
				
			||||||
 | 
					  -h, --help           help for clear
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					      --ttl duration         Duration before cache is re-built in go time.Duration format (default 48h0m0s)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager cache](git-project-manager_cache.md)	 - Manage Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_cache_dump.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_cache_dump.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager cache dump
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Dump Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Dumps cache to display
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager cache dump [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -f, --full   Dumps entire cache
 | 
				
			||||||
 | 
					  -h, --help   help for dump
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					      --ttl duration         Duration before cache is re-built in go time.Duration format (default 48h0m0s)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager cache](git-project-manager_cache.md)	 - Manage Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										36
									
								
								docs/git-project-manager_cache_load.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								docs/git-project-manager_cache_load.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					## git-project-manager cache load
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Load Git Project Cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Used to initialize or update a new Git cache. With thousands
 | 
				
			||||||
 | 
					of projects, it would be too much work to hit the API every time a user
 | 
				
			||||||
 | 
					wants to find a new project.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager cache load [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help        help for load
 | 
				
			||||||
 | 
					      --ownerOnly   Only load projects that you are owner of (default true)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					      --ttl duration         Duration before cache is re-built in go time.Duration format (default 48h0m0s)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager cache](git-project-manager_cache.md)	 - Manage Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_cache_unlock.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_cache_unlock.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager cache unlock
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					unlock Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					unlocks cache to display
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager cache unlock [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -f, --force   force unlocks cache (don't ask)
 | 
				
			||||||
 | 
					  -h, --help    help for unlock
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					      --ttl duration         Duration before cache is re-built in go time.Duration format (default 48h0m0s)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager cache](git-project-manager_cache.md)	 - Manage Git project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_completion.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_completion.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager completion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for the specified shell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for git-project-manager for the specified shell.
 | 
				
			||||||
 | 
					See each sub-command's help for details on how to use the generated script.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for completion
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager](git-project-manager.md)	 - Find and use Git projects locally
 | 
				
			||||||
 | 
					* [git-project-manager completion bash](git-project-manager_completion_bash.md)	 - Generate the autocompletion script for bash
 | 
				
			||||||
 | 
					* [git-project-manager completion fish](git-project-manager_completion_fish.md)	 - Generate the autocompletion script for fish
 | 
				
			||||||
 | 
					* [git-project-manager completion powershell](git-project-manager_completion_powershell.md)	 - Generate the autocompletion script for powershell
 | 
				
			||||||
 | 
					* [git-project-manager completion zsh](git-project-manager_completion_zsh.md)	 - Generate the autocompletion script for zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										53
									
								
								docs/git-project-manager_completion_bash.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								docs/git-project-manager_completion_bash.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,53 @@
 | 
				
			|||||||
 | 
					## git-project-manager completion bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for the bash shell.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This script depends on the 'bash-completion' package.
 | 
				
			||||||
 | 
					If it is not installed already, you can install it via your OS's package manager.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions in your current shell session:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						source <(git-project-manager completion bash)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions for every new session, execute once:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Linux:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion bash > /etc/bash_completion.d/git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### macOS:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion bash > $(brew --prefix)/etc/bash_completion.d/git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You will need to start a new shell for this setup to take effect.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager completion bash
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help              help for bash
 | 
				
			||||||
 | 
					      --no-descriptions   disable completion descriptions
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager completion](git-project-manager_completion.md)	 - Generate the autocompletion script for the specified shell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										44
									
								
								docs/git-project-manager_completion_fish.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								docs/git-project-manager_completion_fish.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,44 @@
 | 
				
			|||||||
 | 
					## git-project-manager completion fish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for fish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for the fish shell.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions in your current shell session:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion fish | source
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions for every new session, execute once:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion fish > ~/.config/fish/completions/git-project-manager.fish
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You will need to start a new shell for this setup to take effect.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager completion fish [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help              help for fish
 | 
				
			||||||
 | 
					      --no-descriptions   disable completion descriptions
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager completion](git-project-manager_completion.md)	 - Generate the autocompletion script for the specified shell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										41
									
								
								docs/git-project-manager_completion_powershell.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										41
									
								
								docs/git-project-manager_completion_powershell.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,41 @@
 | 
				
			|||||||
 | 
					## git-project-manager completion powershell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for powershell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for powershell.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions in your current shell session:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion powershell | Out-String | Invoke-Expression
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions for every new session, add the output of the above command
 | 
				
			||||||
 | 
					to your powershell profile.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager completion powershell [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help              help for powershell
 | 
				
			||||||
 | 
					      --no-descriptions   disable completion descriptions
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager completion](git-project-manager_completion.md)	 - Generate the autocompletion script for the specified shell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										55
									
								
								docs/git-project-manager_completion_zsh.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								docs/git-project-manager_completion_zsh.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,55 @@
 | 
				
			|||||||
 | 
					## git-project-manager completion zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for zsh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate the autocompletion script for the zsh shell.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If shell completion is not already enabled in your environment you will need
 | 
				
			||||||
 | 
					to enable it.  You can execute the following once:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						echo "autoload -U compinit; compinit" >> ~/.zshrc
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions in your current shell session:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						source <(git-project-manager completion zsh)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					To load completions for every new session, execute once:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### Linux:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion zsh > "${fpath[1]}/_git-project-manager"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#### macOS:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						git-project-manager completion zsh > $(brew --prefix)/share/zsh/site-functions/_git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					You will need to start a new shell for this setup to take effect.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager completion zsh [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help              help for zsh
 | 
				
			||||||
 | 
					      --no-descriptions   disable completion descriptions
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager completion](git-project-manager_completion.md)	 - Generate the autocompletion script for the specified shell
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										31
									
								
								docs/git-project-manager_config.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								docs/git-project-manager_config.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					## git-project-manager config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Git Project Manager Configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Commands for managing configuration, particulary
 | 
				
			||||||
 | 
					useful for seeding a new config file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for config
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager](git-project-manager.md)	 - Find and use Git projects locally
 | 
				
			||||||
 | 
					* [git-project-manager config generate](git-project-manager_config_generate.md)	 - Generate a default configuration
 | 
				
			||||||
 | 
					* [git-project-manager config show](git-project-manager_config_show.md)	 - Show Git Project Manager Configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										35
									
								
								docs/git-project-manager_config_generate.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								docs/git-project-manager_config_generate.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					## git-project-manager config generate
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate a default configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Produces yaml to stdout that can be used
 | 
				
			||||||
 | 
					to seed the configuration file
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager config generate [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help     help for generate
 | 
				
			||||||
 | 
					      --prompt   Prompt for settings
 | 
				
			||||||
 | 
					      --write    Write config to file
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager config](git-project-manager_config.md)	 - Git Project Manager Configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										29
									
								
								docs/git-project-manager_config_show.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								docs/git-project-manager_config_show.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					## git-project-manager config show
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Show Git Project Manager Configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager config show [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help        help for show
 | 
				
			||||||
 | 
					  -s, --sensitive   Set to show sensitive fields
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager config](git-project-manager_config.md)	 - Git Project Manager Configuration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										29
									
								
								docs/git-project-manager_docs.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								docs/git-project-manager_docs.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,29 @@
 | 
				
			|||||||
 | 
					## git-project-manager docs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Generate documentation for git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager docs [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -d, --docsPath string   specify output directory for documentation (default "./docs")
 | 
				
			||||||
 | 
					  -h, --help              help for docs
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager](git-project-manager.md)	 - Find and use Git projects locally
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										38
									
								
								docs/git-project-manager_project.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								docs/git-project-manager_project.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,38 @@
 | 
				
			|||||||
 | 
					## git-project-manager project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Switches to a Git project by name or alias
 | 
				
			||||||
 | 
					If not found, will enter fzf mode. If not cloned, will clone
 | 
				
			||||||
 | 
					the project locally.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for project
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager](git-project-manager.md)	 - Find and use Git projects locally
 | 
				
			||||||
 | 
					* [git-project-manager project add](git-project-manager_project_add.md)	 - Add a new Git project
 | 
				
			||||||
 | 
					* [git-project-manager project go](git-project-manager_project_go.md)	 - Go to a Git project
 | 
				
			||||||
 | 
					* [git-project-manager project list](git-project-manager_project_list.md)	 - List Git Projects
 | 
				
			||||||
 | 
					* [git-project-manager project open](git-project-manager_project_open.md)	 - Open project in your IDE
 | 
				
			||||||
 | 
					* [git-project-manager project run](git-project-manager_project_run.md)	 - Run the project (e.g. go run .)
 | 
				
			||||||
 | 
					* [git-project-manager project run](git-project-manager_project_run.md)	 - Run the project (e.g. go run .)
 | 
				
			||||||
 | 
					* [git-project-manager project show](git-project-manager_project_show.md)	 - Show detail for a Git project
 | 
				
			||||||
 | 
					* [git-project-manager project show](git-project-manager_project_show.md)	 - Show detail for a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										33
									
								
								docs/git-project-manager_project_add.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								docs/git-project-manager_project_add.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					## git-project-manager project add
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Add a new Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Adds a new project to the local project path
 | 
				
			||||||
 | 
					uses fuzzy find to locate the project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager project add [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for add
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										36
									
								
								docs/git-project-manager_project_go.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								docs/git-project-manager_project_go.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,36 @@
 | 
				
			|||||||
 | 
					## git-project-manager project go
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Go to a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Go to a project, searching by alias
 | 
				
			||||||
 | 
					If project is not already cloned, its path will be built and it
 | 
				
			||||||
 | 
					will be cloned from source control.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If conf.projects.alwaysPull, a git pull will be ran automatically
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager project go [fuzzy alias search] [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for go
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_project_list.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_project_list.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager project list
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					List Git Projects
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					List locally cloned projects. Optionally
 | 
				
			||||||
 | 
					lists all projects in project cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager project list [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --all    List all, not just cloned locally
 | 
				
			||||||
 | 
					  -h, --help   help for list
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										39
									
								
								docs/git-project-manager_project_open.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								docs/git-project-manager_project_open.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,39 @@
 | 
				
			|||||||
 | 
					## git-project-manager project open
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Open project in your IDE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Opens the given project directory in the editor
 | 
				
			||||||
 | 
					of your choice. Will find certain well-known entrypoints (e.g. main.go).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					If your editor is set in your config file, it will be used, otherwise
 | 
				
			||||||
 | 
					one will be found in your path from a list of known defaults.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager project open [fuzzy alias search] [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --binary string        Path to editor binary
 | 
				
			||||||
 | 
					      --displayName string   Set display name of editor (meant for config file)
 | 
				
			||||||
 | 
					  -h, --help                 help for open
 | 
				
			||||||
 | 
					      --openFlags string     Optional flags when opening project (e.g. --reuse-window)
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										33
									
								
								docs/git-project-manager_project_run.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								docs/git-project-manager_project_run.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					## git-project-manager project run
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Run the project (e.g. go run .)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Runs the current project. Tries to detect
 | 
				
			||||||
 | 
					the language and runs accordingly (e.g. go run .)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager project run [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					  -h, --help   help for run
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										34
									
								
								docs/git-project-manager_project_show.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								docs/git-project-manager_project_show.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,34 @@
 | 
				
			|||||||
 | 
					## git-project-manager project show
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Show detail for a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Synopsis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Shows detail for a particular project
 | 
				
			||||||
 | 
					Will always fuzzy find
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					git-project-manager project show [fuzzy alias search] [flags]
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --current   Use project in CWD rather than fuzzy find
 | 
				
			||||||
 | 
					  -h, --help      help for show
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Options inherited from parent commands
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					      --config string        config file (default is ~/.config/git-project-manager.yaml)
 | 
				
			||||||
 | 
					      --logLevel string      Default log level -- info, warn, error, debug (default "info")
 | 
				
			||||||
 | 
					      --projectPath string   Sets a path for local clones of projects
 | 
				
			||||||
 | 
					      --remote strings       Specify remotes by host for any sub-command. Provide multiple times or comma delimited.
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### SEE ALSO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					* [git-project-manager project](git-project-manager_project.md)	 - Use a Git project
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					###### Auto generated by spf13/cobra on 30-Dec-2024
 | 
				
			||||||
							
								
								
									
										97
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										97
									
								
								go.mod
									
									
									
									
									
								
							@@ -1,85 +1,88 @@
 | 
				
			|||||||
module gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager
 | 
					module gitea.libretechconsulting.com/rmcguire/git-project-manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
go 1.21.2
 | 
					go 1.23.4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require (
 | 
					require (
 | 
				
			||||||
	github.com/go-git/go-git/v5 v5.10.1
 | 
						github.com/go-git/go-git/v5 v5.13.0
 | 
				
			||||||
	github.com/ktr0731/go-fuzzyfinder v0.8.0
 | 
						github.com/ktr0731/go-fuzzyfinder v0.8.0
 | 
				
			||||||
	github.com/lithammer/fuzzysearch v1.1.8
 | 
						github.com/lithammer/fuzzysearch v1.1.8
 | 
				
			||||||
	github.com/pterm/pterm v0.12.71
 | 
						github.com/pterm/pterm v0.12.80
 | 
				
			||||||
	github.com/spf13/cobra v1.8.0
 | 
						github.com/spf13/cobra v1.8.1
 | 
				
			||||||
	github.com/spf13/viper v1.17.0
 | 
						github.com/spf13/viper v1.19.0
 | 
				
			||||||
	github.com/whilp/git-urls v1.0.0
 | 
						github.com/whilp/git-urls v1.0.0
 | 
				
			||||||
	github.com/xanzy/go-gitlab v0.94.0
 | 
						github.com/xanzy/go-gitlab v0.115.0
 | 
				
			||||||
	golang.org/x/exp v0.0.0-20231127185646-65229373498e
 | 
						golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67
 | 
				
			||||||
	golang.org/x/sys v0.15.0
 | 
						golang.org/x/sys v0.28.0
 | 
				
			||||||
	gopkg.in/yaml.v3 v3.0.1
 | 
						gopkg.in/yaml.v3 v3.0.1
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					require (
 | 
				
			||||||
 | 
						github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
 | 
				
			||||||
 | 
						github.com/mmcloughlin/avo v0.6.0 // indirect
 | 
				
			||||||
 | 
						github.com/russross/blackfriday/v2 v2.1.0 // indirect
 | 
				
			||||||
 | 
						golang.org/x/mod v0.22.0 // indirect
 | 
				
			||||||
 | 
						golang.org/x/sync v0.10.0 // indirect
 | 
				
			||||||
 | 
						golang.org/x/tools v0.28.0 // indirect
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require (
 | 
					require (
 | 
				
			||||||
	atomicgo.dev/cursor v0.2.0 // indirect
 | 
						atomicgo.dev/cursor v0.2.0 // indirect
 | 
				
			||||||
	atomicgo.dev/keyboard v0.2.9 // indirect
 | 
						atomicgo.dev/keyboard v0.2.9 // indirect
 | 
				
			||||||
	atomicgo.dev/schedule v0.1.0 // indirect
 | 
						atomicgo.dev/schedule v0.1.0 // indirect
 | 
				
			||||||
	code.gitea.io/sdk/gitea v0.17.1 // indirect
 | 
						code.gitea.io/sdk/gitea v0.19.0 // direct
 | 
				
			||||||
	dario.cat/mergo v1.0.0 // indirect
 | 
						dario.cat/mergo v1.0.1 // indirect
 | 
				
			||||||
	github.com/Microsoft/go-winio v0.6.1 // indirect
 | 
						github.com/Microsoft/go-winio v0.6.2 // indirect
 | 
				
			||||||
	github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
 | 
						github.com/ProtonMail/go-crypto v1.1.3 // indirect
 | 
				
			||||||
	github.com/cloudflare/circl v1.3.3 // indirect
 | 
						github.com/cloudflare/circl v1.5.0 // indirect
 | 
				
			||||||
	github.com/containerd/console v1.0.3 // indirect
 | 
						github.com/containerd/console v1.0.4 // indirect
 | 
				
			||||||
	github.com/cyphar/filepath-securejoin v0.2.4 // indirect
 | 
						github.com/cyphar/filepath-securejoin v0.3.6 // indirect
 | 
				
			||||||
	github.com/davidmz/go-pageant v1.0.2 // indirect
 | 
						github.com/davidmz/go-pageant v1.0.2 // indirect
 | 
				
			||||||
	github.com/emirpasic/gods v1.18.1 // indirect
 | 
						github.com/emirpasic/gods v1.18.1 // indirect
 | 
				
			||||||
	github.com/fsnotify/fsnotify v1.6.0 // indirect
 | 
						github.com/fsnotify/fsnotify v1.8.0 // indirect
 | 
				
			||||||
	github.com/gdamore/encoding v1.0.0 // indirect
 | 
						github.com/gdamore/encoding v1.0.1 // indirect
 | 
				
			||||||
	github.com/gdamore/tcell/v2 v2.6.0 // indirect
 | 
						github.com/gdamore/tcell/v2 v2.7.4 // indirect
 | 
				
			||||||
	github.com/go-fed/httpsig v1.1.0 // indirect
 | 
						github.com/go-fed/httpsig v1.1.0 // indirect
 | 
				
			||||||
	github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
 | 
						github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
 | 
				
			||||||
	github.com/go-git/go-billy/v5 v5.5.0 // indirect
 | 
						github.com/go-git/go-billy/v5 v5.6.1 // indirect
 | 
				
			||||||
	github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
 | 
						github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
 | 
				
			||||||
	github.com/golang/protobuf v1.5.3 // indirect
 | 
						github.com/google/go-github/v58 v58.0.0 // direct
 | 
				
			||||||
	github.com/google/go-github/v58 v58.0.0 // indirect
 | 
					 | 
				
			||||||
	github.com/google/go-querystring v1.1.0 // indirect
 | 
						github.com/google/go-querystring v1.1.0 // indirect
 | 
				
			||||||
	github.com/gookit/color v1.5.4 // indirect
 | 
						github.com/gookit/color v1.5.4 // indirect
 | 
				
			||||||
	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
 | 
						github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
 | 
				
			||||||
	github.com/hashicorp/go-retryablehttp v0.7.2 // indirect
 | 
						github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
 | 
				
			||||||
	github.com/hashicorp/go-version v1.6.0 // indirect
 | 
						github.com/hashicorp/go-version v1.7.0 // indirect
 | 
				
			||||||
	github.com/hashicorp/hcl v1.0.0 // indirect
 | 
						github.com/hashicorp/hcl v1.0.0 // indirect
 | 
				
			||||||
	github.com/inconshreveable/mousetrap v1.1.0 // indirect
 | 
						github.com/inconshreveable/mousetrap v1.1.0 // indirect
 | 
				
			||||||
	github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
 | 
						github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
 | 
				
			||||||
	github.com/kevinburke/ssh_config v1.2.0 // indirect
 | 
						github.com/kevinburke/ssh_config v1.2.0 // indirect
 | 
				
			||||||
	github.com/ktr0731/go-ansisgr v0.1.0 // indirect
 | 
						github.com/ktr0731/go-ansisgr v0.1.0 // indirect
 | 
				
			||||||
	github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
 | 
						github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
 | 
				
			||||||
	github.com/magiconair/properties v1.8.7 // indirect
 | 
						github.com/magiconair/properties v1.8.9 // indirect
 | 
				
			||||||
	github.com/mattn/go-runewidth v0.0.15 // indirect
 | 
						github.com/mattn/go-runewidth v0.0.16 // indirect
 | 
				
			||||||
	github.com/mitchellh/mapstructure v1.5.0 // indirect
 | 
						github.com/mitchellh/mapstructure v1.5.0 // indirect
 | 
				
			||||||
	github.com/nsf/termbox-go v1.1.1 // indirect
 | 
						github.com/nsf/termbox-go v1.1.1 // indirect
 | 
				
			||||||
	github.com/pelletier/go-toml/v2 v2.1.0 // indirect
 | 
						github.com/pelletier/go-toml/v2 v2.2.3 // indirect
 | 
				
			||||||
	github.com/pjbgf/sha1cd v0.3.0 // indirect
 | 
						github.com/pjbgf/sha1cd v0.3.1 // indirect
 | 
				
			||||||
	github.com/pkg/errors v0.9.1 // indirect
 | 
						github.com/pkg/errors v0.9.1 // indirect
 | 
				
			||||||
	github.com/rivo/uniseg v0.4.4 // indirect
 | 
						github.com/rivo/uniseg v0.4.7 // indirect
 | 
				
			||||||
	github.com/sagikazarmark/locafero v0.3.0 // indirect
 | 
						github.com/sagikazarmark/locafero v0.6.0 // indirect
 | 
				
			||||||
	github.com/sagikazarmark/slog-shim v0.1.0 // indirect
 | 
						github.com/sagikazarmark/slog-shim v0.1.0 // indirect
 | 
				
			||||||
	github.com/sergi/go-diff v1.2.0 // indirect
 | 
						github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
 | 
				
			||||||
	github.com/skeema/knownhosts v1.2.1 // indirect
 | 
						github.com/skeema/knownhosts v1.3.0 // indirect
 | 
				
			||||||
	github.com/sourcegraph/conc v0.3.0 // indirect
 | 
						github.com/sourcegraph/conc v0.3.0 // indirect
 | 
				
			||||||
	github.com/spf13/afero v1.10.0 // indirect
 | 
						github.com/spf13/afero v1.11.0 // indirect
 | 
				
			||||||
	github.com/spf13/cast v1.5.1 // indirect
 | 
						github.com/spf13/cast v1.7.1 // indirect
 | 
				
			||||||
	github.com/spf13/pflag v1.0.5 // indirect
 | 
						github.com/spf13/pflag v1.0.5 // indirect
 | 
				
			||||||
	github.com/subosito/gotenv v1.6.0 // indirect
 | 
						github.com/subosito/gotenv v1.6.0 // indirect
 | 
				
			||||||
	github.com/xanzy/ssh-agent v0.3.3 // indirect
 | 
						github.com/xanzy/ssh-agent v0.3.3 // indirect
 | 
				
			||||||
	github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
 | 
						github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
 | 
				
			||||||
	go.uber.org/atomic v1.9.0 // indirect
 | 
						go.uber.org/multierr v1.11.0 // indirect
 | 
				
			||||||
	go.uber.org/multierr v1.9.0 // indirect
 | 
						golang.org/x/crypto v0.31.0 // indirect
 | 
				
			||||||
	golang.org/x/crypto v0.17.0 // indirect
 | 
						golang.org/x/net v0.33.0 // indirect
 | 
				
			||||||
	golang.org/x/mod v0.14.0 // indirect
 | 
						golang.org/x/oauth2 v0.24.0 // indirect
 | 
				
			||||||
	golang.org/x/net v0.19.0 // indirect
 | 
						golang.org/x/term v0.27.0 // indirect
 | 
				
			||||||
	golang.org/x/oauth2 v0.12.0 // indirect
 | 
						golang.org/x/text v0.21.0 // indirect
 | 
				
			||||||
	golang.org/x/term v0.15.0 // indirect
 | 
						golang.org/x/time v0.8.0 // indirect
 | 
				
			||||||
	golang.org/x/text v0.14.0 // indirect
 | 
					 | 
				
			||||||
	golang.org/x/time v0.3.0 // indirect
 | 
					 | 
				
			||||||
	golang.org/x/tools v0.16.0 // indirect
 | 
					 | 
				
			||||||
	google.golang.org/appengine v1.6.7 // indirect
 | 
					 | 
				
			||||||
	google.golang.org/protobuf v1.31.0 // indirect
 | 
					 | 
				
			||||||
	gopkg.in/ini.v1 v1.67.0 // indirect
 | 
						gopkg.in/ini.v1 v1.67.0 // indirect
 | 
				
			||||||
	gopkg.in/warnings.v0 v0.1.2 // indirect
 | 
						gopkg.in/warnings.v0 v0.1.2 // indirect
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										636
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										636
									
								
								go.sum
									
									
									
									
									
								
							@@ -6,50 +6,10 @@ atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8=
 | 
				
			|||||||
atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ=
 | 
					atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ=
 | 
				
			||||||
atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs=
 | 
					atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs=
 | 
				
			||||||
atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU=
 | 
					atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU=
 | 
				
			||||||
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 | 
					code.gitea.io/sdk/gitea v0.19.0 h1:8I6s1s4RHgzxiPHhOQdgim1RWIRcr0LVMbHBjBFXq4Y=
 | 
				
			||||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 | 
					code.gitea.io/sdk/gitea v0.19.0/go.mod h1:IG9xZJoltDNeDSW0qiF2Vqx5orMWa7OhVWrjvrd5NpI=
 | 
				
			||||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
 | 
					dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
 | 
				
			||||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
 | 
					dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
 | 
				
			||||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
 | 
					 | 
				
			||||||
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
 | 
					 | 
				
			||||||
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
 | 
					 | 
				
			||||||
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
 | 
					 | 
				
			||||||
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
 | 
					 | 
				
			||||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
 | 
					 | 
				
			||||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
 | 
					 | 
				
			||||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
 | 
					 | 
				
			||||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
 | 
					 | 
				
			||||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
 | 
					 | 
				
			||||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
 | 
					 | 
				
			||||||
cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
 | 
					 | 
				
			||||||
cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
 | 
					 | 
				
			||||||
cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
 | 
					 | 
				
			||||||
cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
 | 
					 | 
				
			||||||
cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
 | 
					 | 
				
			||||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
 | 
					 | 
				
			||||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
 | 
					 | 
				
			||||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
 | 
					 | 
				
			||||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
 | 
					 | 
				
			||||||
code.gitea.io/sdk/gitea v0.17.1 h1:3jCPOG2ojbl8AcfaUCRYLT5MUcBMFwS0OSK2mA5Zok8=
 | 
					 | 
				
			||||||
code.gitea.io/sdk/gitea v0.17.1/go.mod h1:aCnBqhHpoEWA180gMbaCtdX9Pl6BWBAuuP2miadoTNM=
 | 
					 | 
				
			||||||
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
 | 
					 | 
				
			||||||
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
 | 
					 | 
				
			||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
 | 
					 | 
				
			||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 | 
					 | 
				
			||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 | 
					 | 
				
			||||||
github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs=
 | 
					github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs=
 | 
				
			||||||
github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8=
 | 
					github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8=
 | 
				
			||||||
github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII=
 | 
					github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII=
 | 
				
			||||||
@@ -60,31 +20,25 @@ github.com/MarvinJWendt/testza v0.4.2/go.mod h1:mSdhXiKH8sg/gQehJ63bINcCKp7RtYew
 | 
				
			|||||||
github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4=
 | 
					github.com/MarvinJWendt/testza v0.5.2 h1:53KDo64C1z/h/d/stCYCPY69bt/OSwjq5KpFNwi+zB4=
 | 
				
			||||||
github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY=
 | 
					github.com/MarvinJWendt/testza v0.5.2/go.mod h1:xu53QFE5sCdjtMCKk8YMQ2MnymimEctc4n3EjyIYvEY=
 | 
				
			||||||
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
 | 
					github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
 | 
				
			||||||
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
 | 
					github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
 | 
				
			||||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
 | 
					github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
 | 
				
			||||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
 | 
					github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk=
 | 
				
			||||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
 | 
					github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
 | 
				
			||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
 | 
				
			||||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
 | 
					github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
 | 
				
			||||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
 | 
					github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
 | 
				
			||||||
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
 | 
					github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
 | 
				
			||||||
github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk=
 | 
					github.com/atomicgo/cursor v0.0.1/go.mod h1:cBON2QmmrysudxNBFthvMtN32r3jxVRIvzkUiF/RuIk=
 | 
				
			||||||
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
 | 
					github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys=
 | 
				
			||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 | 
					github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
 | 
				
			||||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
 | 
					 | 
				
			||||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
 | 
					 | 
				
			||||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
 | 
					 | 
				
			||||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 | 
					 | 
				
			||||||
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
 | 
					 | 
				
			||||||
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
 | 
					 | 
				
			||||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
 | 
					 | 
				
			||||||
github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
 | 
					 | 
				
			||||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
 | 
					 | 
				
			||||||
github.com/containerd/console v1.0.3 h1:lIr7SlA5PxZyMV30bDW0MGbiOPXwc63yRuCP0ARubLw=
 | 
					 | 
				
			||||||
github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
 | 
					github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U=
 | 
				
			||||||
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 | 
					github.com/containerd/console v1.0.4 h1:F2g4+oChYvBTsASRTz8NP6iIAi97J3TtSAsLbIFn4ro=
 | 
				
			||||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
 | 
					github.com/containerd/console v1.0.4/go.mod h1:YynlIjWYF8myEu6sdkwKIvGQq+cOckRm6So2avqoYAk=
 | 
				
			||||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
 | 
					github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
 | 
				
			||||||
 | 
					github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
 | 
				
			||||||
 | 
					github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
 | 
				
			||||||
 | 
					github.com/cyphar/filepath-securejoin v0.3.6 h1:4d9N5ykBnSp5Xn2JkhocYDkOpURL/18CYMpo6xB9uWM=
 | 
				
			||||||
 | 
					github.com/cyphar/filepath-securejoin v0.3.6/go.mod h1:Sdj7gXlvMcPZsbhwhQ33GguGLDGQL7h7bg04C/+u9jI=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
					github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
					github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 | 
				
			||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
 | 
					github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
 | 
				
			||||||
@@ -93,81 +47,41 @@ github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454Wv
 | 
				
			|||||||
github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE=
 | 
					github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE=
 | 
				
			||||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
 | 
					github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
 | 
				
			||||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
 | 
					github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
 | 
				
			||||||
 | 
					github.com/elazarl/goproxy v1.2.1 h1:njjgvO6cRG9rIqN2ebkqy6cQz2Njkx7Fsfv/zIZqgug=
 | 
				
			||||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
 | 
					github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
 | 
				
			||||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
 | 
					github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
					github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 | 
					github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
 | 
					github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
 | 
					github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
 | 
				
			||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
 | 
					github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
 | 
				
			||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 | 
					github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
 | 
				
			||||||
github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w=
 | 
					 | 
				
			||||||
github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg=
 | 
					 | 
				
			||||||
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
 | 
					 | 
				
			||||||
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
 | 
					 | 
				
			||||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
 | 
					 | 
				
			||||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
 | 
					 | 
				
			||||||
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
 | 
					 | 
				
			||||||
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
 | 
					github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
 | 
				
			||||||
github.com/gdamore/tcell/v2 v2.6.0 h1:OKbluoP9VYmJwZwq/iLb4BxwKcwGthaa1YNBJIyCySg=
 | 
					github.com/gdamore/encoding v1.0.1 h1:YzKZckdBL6jVt2Gc+5p82qhrGiqMdG/eNs6Wy0u3Uhw=
 | 
				
			||||||
 | 
					github.com/gdamore/encoding v1.0.1/go.mod h1:0Z0cMFinngz9kS1QfMjCP8TY7em3bZYeeklsSDPivEo=
 | 
				
			||||||
github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y=
 | 
					github.com/gdamore/tcell/v2 v2.6.0/go.mod h1:be9omFATkdr0D9qewWW3d+MEvl5dha+Etb5y65J2H8Y=
 | 
				
			||||||
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
 | 
					github.com/gdamore/tcell/v2 v2.7.4 h1:sg6/UnTM9jGpZU+oFYAsDahfchWAFW8Xx2yFinNSAYU=
 | 
				
			||||||
github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4=
 | 
					github.com/gdamore/tcell/v2 v2.7.4/go.mod h1:dSXtXTSK0VsW1biw65DZLZ2NKr7j0qP/0J7ONmsraWg=
 | 
				
			||||||
 | 
					github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE=
 | 
				
			||||||
 | 
					github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8=
 | 
				
			||||||
 | 
					github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
 | 
				
			||||||
github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI=
 | 
					github.com/go-fed/httpsig v1.1.0 h1:9M+hb0jkEICD8/cAiNqEB66R87tTINszBRTjwjQzWcI=
 | 
				
			||||||
github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
 | 
					github.com/go-fed/httpsig v1.1.0/go.mod h1:RCMrTZvN1bJYtofsG4rd5NaO5obxQ5xBkdiS7xsT7bM=
 | 
				
			||||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
 | 
					github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
 | 
				
			||||||
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
 | 
					github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
 | 
				
			||||||
github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
 | 
					github.com/go-git/go-billy/v5 v5.6.0 h1:w2hPNtoehvJIxR00Vb4xX94qHQi/ApZfX+nBE2Cjio8=
 | 
				
			||||||
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
 | 
					github.com/go-git/go-billy/v5 v5.6.0/go.mod h1:sFDq7xD3fn3E0GOwUSZqHo9lrkmx8xJhA0ZrfvjBRGM=
 | 
				
			||||||
 | 
					github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/SoRA=
 | 
				
			||||||
 | 
					github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE=
 | 
				
			||||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
 | 
					github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMje31YglSBqCdIqdhKBW8lokaMrL3uTkpGYlE2OOT4=
 | 
				
			||||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
 | 
					github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII=
 | 
				
			||||||
github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk=
 | 
					github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
 | 
				
			||||||
github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg=
 | 
					github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
 | 
				
			||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
 | 
					github.com/go-git/go-git/v5 v5.13.0 h1:vLn5wlGIh/X78El6r3Jr+30W16Blk0CTcxTYcYPWi5E=
 | 
				
			||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
					github.com/go-git/go-git/v5 v5.13.0/go.mod h1:Wjo7/JyVKtQgUNdXYXIepzWfJQkUEIGvkvVkiXRR/zw=
 | 
				
			||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
 | 
					github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=
 | 
				
			||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 | 
					github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8/go.mod h1:wcDNUvekVysuuOpQKo3191zZyTpiI6se1N1ULghS0sw=
 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
 | 
					 | 
				
			||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
 | 
					 | 
				
			||||||
github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
 | 
					 | 
				
			||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
 | 
					 | 
				
			||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 | 
					 | 
				
			||||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
				
			||||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
 | 
					 | 
				
			||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
 | 
					github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
 | 
				
			||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 | 
					github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
 | 
				
			||||||
github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw=
 | 
					github.com/google/go-github/v58 v58.0.0 h1:Una7GGERlF/37XfkPwpzYJe0Vp4dt2k1kCjlxwjIvzw=
 | 
				
			||||||
@@ -176,58 +90,31 @@ github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD
 | 
				
			|||||||
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
 | 
					github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
 | 
				
			||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
 | 
					github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
 | 
				
			||||||
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 | 
					github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
 | 
				
			||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
 | 
					 | 
				
			||||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 | 
					 | 
				
			||||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 | 
					 | 
				
			||||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 | 
					 | 
				
			||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 | 
					 | 
				
			||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
 | 
					 | 
				
			||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
 | 
					 | 
				
			||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
 | 
					 | 
				
			||||||
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
 | 
					 | 
				
			||||||
github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ=
 | 
					github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ=
 | 
				
			||||||
github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo=
 | 
					github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo=
 | 
				
			||||||
github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
 | 
					github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
 | 
				
			||||||
github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w=
 | 
					github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w=
 | 
				
			||||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
 | 
					github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
 | 
				
			||||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
 | 
					github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
 | 
				
			||||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
 | 
					github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
 | 
				
			||||||
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
 | 
					github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
 | 
				
			||||||
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
 | 
					github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
 | 
				
			||||||
github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0=
 | 
					github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
 | 
				
			||||||
github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8=
 | 
					github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY=
 | 
				
			||||||
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
 | 
					github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
 | 
				
			||||||
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
 | 
					 | 
				
			||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 | 
					 | 
				
			||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 | 
					 | 
				
			||||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
 | 
					github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
 | 
				
			||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
 | 
					github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
 | 
				
			||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
					 | 
				
			||||||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
 | 
					 | 
				
			||||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
 | 
					github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
 | 
				
			||||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
 | 
					github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
 | 
				
			||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
 | 
					github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
 | 
				
			||||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
 | 
					github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
 | 
				
			||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
 | 
					 | 
				
			||||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
 | 
					 | 
				
			||||||
github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
 | 
					github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4=
 | 
				
			||||||
github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
 | 
					github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
 | 
				
			||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
 | 
					 | 
				
			||||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
 | 
					github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
 | 
				
			||||||
github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
 | 
					github.com/klauspost/cpuid/v2 v2.0.10/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
 | 
				
			||||||
github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
 | 
					github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c=
 | 
				
			||||||
github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU=
 | 
					github.com/klauspost/cpuid/v2 v2.2.3 h1:sxCkb+qR91z4vsqw4vGGZlDgPz3G7gjaLyK3V8y70BU=
 | 
				
			||||||
github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
 | 
					github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
 | 
				
			||||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
 | 
					 | 
				
			||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 | 
					github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 | 
				
			||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
 | 
					github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
 | 
				
			||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
 | 
					github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
 | 
				
			||||||
@@ -243,34 +130,37 @@ github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8
 | 
				
			|||||||
github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4=
 | 
					github.com/lithammer/fuzzysearch v1.1.8/go.mod h1:IdqeyBClc3FFqSzYq/MXESsS4S0FsZ5ajtkr5xPLts4=
 | 
				
			||||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
 | 
					github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
 | 
				
			||||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
 | 
					github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
 | 
				
			||||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
 | 
					github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM=
 | 
				
			||||||
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
 | 
					github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
 | 
				
			||||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
 | 
					github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
 | 
				
			||||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
 | 
					github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
 | 
					github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
 | 
				
			||||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
 | 
					github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 | 
					github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
					github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
					github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
 | 
					 | 
				
			||||||
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
					github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
				
			||||||
 | 
					github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc=
 | 
				
			||||||
 | 
					github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
 | 
				
			||||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
 | 
					github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
 | 
				
			||||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
 | 
					github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
 | 
				
			||||||
 | 
					github.com/mmcloughlin/avo v0.6.0 h1:QH6FU8SKoTLaVs80GA8TJuLNkUYl4VokHKlPhVDg4YY=
 | 
				
			||||||
 | 
					github.com/mmcloughlin/avo v0.6.0/go.mod h1:8CoAGaCSYXtCPR+8y18Y9aB/kxb8JSS6FRI7mSkvD+8=
 | 
				
			||||||
github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY=
 | 
					github.com/nsf/termbox-go v1.1.1 h1:nksUPLCb73Q++DwbYUBEglYBRPZyoXJdrj5L+TkjyZY=
 | 
				
			||||||
github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=
 | 
					github.com/nsf/termbox-go v1.1.1/go.mod h1:T0cTdVuOwf7pHQNtfhnEbzHbcNyCEcVU4YPpouCbVxo=
 | 
				
			||||||
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
 | 
					github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
 | 
				
			||||||
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
 | 
					github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
 | 
				
			||||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
 | 
					github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
 | 
				
			||||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
 | 
					github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
 | 
				
			||||||
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
 | 
					github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
 | 
				
			||||||
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
 | 
					github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
 | 
				
			||||||
 | 
					github.com/pjbgf/sha1cd v0.3.1 h1:Dh2GYdpJnO84lIw0LJwTFXjcNbasP/bklicSznyAaPI=
 | 
				
			||||||
 | 
					github.com/pjbgf/sha1cd v0.3.1/go.mod h1:Y8t7jSB/dEI/lQE04A1HVKteqjj9bX5O4+Cex0TCu8s=
 | 
				
			||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 | 
					github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
 | 
				
			||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
					github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 | 
				
			||||||
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
 | 
					 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
					github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
 | 
					github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
 | 
				
			||||||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
					github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
 | 
				
			||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
 | 
					 | 
				
			||||||
github.com/pterm/pterm v0.12.27/go.mod h1:PhQ89w4i95rhgE+xedAoqous6K9X+r6aSOI2eFF7DZI=
 | 
					github.com/pterm/pterm v0.12.27/go.mod h1:PhQ89w4i95rhgE+xedAoqous6K9X+r6aSOI2eFF7DZI=
 | 
				
			||||||
github.com/pterm/pterm v0.12.29/go.mod h1:WI3qxgvoQFFGKGjGnJR849gU0TsEOvKn5Q8LlY1U7lg=
 | 
					github.com/pterm/pterm v0.12.29/go.mod h1:WI3qxgvoQFFGKGjGnJR849gU0TsEOvKn5Q8LlY1U7lg=
 | 
				
			||||||
github.com/pterm/pterm v0.12.30/go.mod h1:MOqLIyMOgmTDz9yorcYbcw+HsgoZo3BQfg2wtl3HEFE=
 | 
					github.com/pterm/pterm v0.12.30/go.mod h1:MOqLIyMOgmTDz9yorcYbcw+HsgoZo3BQfg2wtl3HEFE=
 | 
				
			||||||
@@ -278,446 +168,144 @@ github.com/pterm/pterm v0.12.31/go.mod h1:32ZAWZVXD7ZfG0s8qqHXePte42kdz8ECtRyEej
 | 
				
			|||||||
github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE=
 | 
					github.com/pterm/pterm v0.12.33/go.mod h1:x+h2uL+n7CP/rel9+bImHD5lF3nM9vJj80k9ybiiTTE=
 | 
				
			||||||
github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8=
 | 
					github.com/pterm/pterm v0.12.36/go.mod h1:NjiL09hFhT/vWjQHSj1athJpx6H8cjpHXNAK5bUw8T8=
 | 
				
			||||||
github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s=
 | 
					github.com/pterm/pterm v0.12.40/go.mod h1:ffwPLwlbXxP+rxT0GsgDTzS3y3rmpAO1NMjUkGTYf8s=
 | 
				
			||||||
github.com/pterm/pterm v0.12.71 h1:KcEJ98EiVCbzDkFbktJ2gMlr4pn8IzyGb9bwK6ffkuA=
 | 
					github.com/pterm/pterm v0.12.80 h1:mM55B+GnKUnLMUSqhdINe4s6tOuVQIetQ3my8JGyAIg=
 | 
				
			||||||
github.com/pterm/pterm v0.12.71/go.mod h1:SUAcoZjRt+yjPWlWba+/Fd8zJJ2lSXBQWf0Z0HbFiIQ=
 | 
					github.com/pterm/pterm v0.12.80/go.mod h1:c6DeF9bSnOSeFPZlfs4ZRAFcf5SCoTwvwQ5xaKGQlHo=
 | 
				
			||||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 | 
					github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
 | 
				
			||||||
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 | 
					github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 | 
				
			||||||
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
 | 
					github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
 | 
				
			||||||
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 | 
					github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
 | 
				
			||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 | 
					 | 
				
			||||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
 | 
					github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
 | 
				
			||||||
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
 | 
					github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
 | 
				
			||||||
 | 
					github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
 | 
				
			||||||
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
					github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 | 
				
			||||||
github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ=
 | 
					github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk=
 | 
				
			||||||
github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U=
 | 
					github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0=
 | 
				
			||||||
github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
 | 
					github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE=
 | 
				
			||||||
github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
 | 
					github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ=
 | 
				
			||||||
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
 | 
					 | 
				
			||||||
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 | 
					github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
 | 
				
			||||||
 | 
					github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
 | 
				
			||||||
 | 
					github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
 | 
				
			||||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
 | 
					github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
 | 
				
			||||||
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
 | 
					github.com/skeema/knownhosts v1.3.0 h1:AM+y0rI04VksttfwjkSTNQorvGqmwATnvnAHpSgc0LY=
 | 
				
			||||||
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
 | 
					github.com/skeema/knownhosts v1.3.0/go.mod h1:sPINvnADmT/qYH1kfv+ePMmOBTH6Tbl7b5LvTDjFK7M=
 | 
				
			||||||
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
 | 
					github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
 | 
				
			||||||
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
 | 
					github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
 | 
				
			||||||
github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
 | 
					github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
 | 
				
			||||||
github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
 | 
					github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
 | 
				
			||||||
github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA=
 | 
					github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y=
 | 
				
			||||||
github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48=
 | 
					github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
 | 
				
			||||||
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
 | 
					github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM=
 | 
				
			||||||
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
 | 
					github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y=
 | 
				
			||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 | 
					github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
 | 
				
			||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 | 
					github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
 | 
				
			||||||
github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI=
 | 
					github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI=
 | 
				
			||||||
github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI=
 | 
					github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg=
 | 
				
			||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
					github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 | 
				
			||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 | 
					 | 
				
			||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
 | 
					 | 
				
			||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 | 
					github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 | 
				
			||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
 | 
					 | 
				
			||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 | 
					github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
 | 
				
			||||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
 | 
					 | 
				
			||||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
					github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
				
			||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
					github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
				
			||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 | 
					github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
 | 
				
			||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 | 
					github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
 | 
				
			||||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
 | 
					 | 
				
			||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
 | 
					 | 
				
			||||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
 | 
					github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
 | 
				
			||||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
 | 
					github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
 | 
				
			||||||
github.com/whilp/git-urls v1.0.0 h1:95f6UMWN5FKW71ECsXRUd3FVYiXdrE7aX4NZKcPmIjU=
 | 
					github.com/whilp/git-urls v1.0.0 h1:95f6UMWN5FKW71ECsXRUd3FVYiXdrE7aX4NZKcPmIjU=
 | 
				
			||||||
github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgwk/qCfE=
 | 
					github.com/whilp/git-urls v1.0.0/go.mod h1:J16SAmobsqc3Qcy98brfl5f5+e0clUvg1krgwk/qCfE=
 | 
				
			||||||
github.com/xanzy/go-gitlab v0.94.0 h1:GmBl2T5zqUHqyjkxFSvsT7CbelGdAH/dmBqUBqS+4BE=
 | 
					github.com/xanzy/go-gitlab v0.115.0 h1:6DmtItNcVe+At/liXSgfE/DZNZrGfalQmBRmOcJjOn8=
 | 
				
			||||||
github.com/xanzy/go-gitlab v0.94.0/go.mod h1:ETg8tcj4OhrB84UEgeE8dSuV/0h4BBL1uOV/qK0vlyI=
 | 
					github.com/xanzy/go-gitlab v0.115.0/go.mod h1:5XCDtM7AM6WMKmfDdOiEpyRWUqui2iS9ILfvCZ2gJ5M=
 | 
				
			||||||
github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
 | 
					github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM=
 | 
				
			||||||
github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
 | 
					github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw=
 | 
				
			||||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
 | 
					github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
 | 
				
			||||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
 | 
					github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
 | 
				
			||||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
 | 
					github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
 | 
				
			||||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
					 | 
				
			||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
					 | 
				
			||||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
					 | 
				
			||||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 | 
					 | 
				
			||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 | 
					github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
 | 
				
			||||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
 | 
					go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
 | 
				
			||||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
 | 
					go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
 | 
				
			||||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
					 | 
				
			||||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
					 | 
				
			||||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
 | 
					 | 
				
			||||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
 | 
					 | 
				
			||||||
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
 | 
					 | 
				
			||||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
 | 
					 | 
				
			||||||
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
 | 
					 | 
				
			||||||
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 | 
					golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
					golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
 | 
					golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 | 
					golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 | 
					golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 | 
				
			||||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 | 
					golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
 | 
				
			||||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
 | 
					golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
 | 
				
			||||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
 | 
					golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
 | 
				
			||||||
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
 | 
					golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
 | 
				
			||||||
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
 | 
					 | 
				
			||||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20231127185646-65229373498e h1:Gvh4YaCaXNs6dKTlfgismwWZKyjVZXwOPfIyUaqU3No=
 | 
					 | 
				
			||||||
golang.org/x/exp v0.0.0-20231127185646-65229373498e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
 | 
					 | 
				
			||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
 | 
					 | 
				
			||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
 | 
					 | 
				
			||||||
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
 | 
					 | 
				
			||||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
 | 
					 | 
				
			||||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
 | 
					 | 
				
			||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 | 
					golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 | 
				
			||||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 | 
					golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
 | 
				
			||||||
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
 | 
					golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
 | 
				
			||||||
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
 | 
					golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
 | 
				
			||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
				
			||||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 | 
					 | 
				
			||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 | 
					golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
 | 
				
			||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
					golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 | 
				
			||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 | 
					golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
 | 
				
			||||||
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
 | 
					 | 
				
			||||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 | 
					golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
 | 
				
			||||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
 | 
					golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
 | 
				
			||||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
 | 
					golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
 | 
				
			||||||
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
 | 
					golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
 | 
				
			||||||
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
 | 
					golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
 | 
					 | 
				
			||||||
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					 | 
				
			||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
					golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 | 
				
			||||||
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
 | 
					golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
 | 
				
			||||||
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 | 
					golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
					golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20211013075003-97ac67df715c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					 | 
				
			||||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
				
			||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 | 
				
			||||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 | 
					golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
 | 
				
			||||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
 | 
					golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 | 
				
			||||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
 | 
					 | 
				
			||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 | 
					golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 | 
				
			||||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 | 
					golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 | 
				
			||||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 | 
					golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 | 
				
			||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 | 
					golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 | 
				
			||||||
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
 | 
					 | 
				
			||||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
 | 
					golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
 | 
				
			||||||
golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U=
 | 
					golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
 | 
				
			||||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
 | 
					golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
 | 
				
			||||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
 | 
					golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
 | 
				
			||||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
 | 
					 | 
				
			||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
					 | 
				
			||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
					golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
				
			||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 | 
					 | 
				
			||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
 | 
					 | 
				
			||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					 | 
				
			||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
					golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 | 
				
			||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 | 
					golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
 | 
				
			||||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 | 
					 | 
				
			||||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 | 
					golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
 | 
				
			||||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 | 
					 | 
				
			||||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 | 
					golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
 | 
				
			||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
 | 
					 | 
				
			||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
 | 
					golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
 | 
				
			||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
 | 
				
			||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
 | 
				
			||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
 | 
				
			||||||
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
 | 
					golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
 | 
				
			||||||
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
				
			||||||
golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
 | 
					 | 
				
			||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
 | 
					golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
 | 
				
			||||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
 | 
					golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
 | 
				
			||||||
golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
 | 
					golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8=
 | 
				
			||||||
golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
 | 
					golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
				
			||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 | 
					 | 
				
			||||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
 | 
					 | 
				
			||||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
 | 
					 | 
				
			||||||
google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
 | 
					 | 
				
			||||||
google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
 | 
					 | 
				
			||||||
google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
 | 
					 | 
				
			||||||
google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
 | 
					 | 
				
			||||||
google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
 | 
					 | 
				
			||||||
google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
 | 
					 | 
				
			||||||
google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
 | 
					 | 
				
			||||||
google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
 | 
					 | 
				
			||||||
google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
 | 
					 | 
				
			||||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
 | 
					 | 
				
			||||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
 | 
					 | 
				
			||||||
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 | 
					 | 
				
			||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
					gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
					 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
					gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 | 
					gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
 | 
				
			||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 | 
					gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
 | 
				
			||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 | 
					 | 
				
			||||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
 | 
					gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
 | 
				
			||||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 | 
					gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
 | 
				
			||||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
 | 
					gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
 | 
				
			||||||
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
 | 
					gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
 | 
				
			||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
					gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
					gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 | 
				
			||||||
 | 
					gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
					gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
					gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 | 
					gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 | 
				
			||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
					gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
					 | 
				
			||||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 | 
					 | 
				
			||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
 | 
					 | 
				
			||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
 | 
					 | 
				
			||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										36
									
								
								internal/cache/cache.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										36
									
								
								internal/cache/cache.go
									
									
									
									
										vendored
									
									
								
							@@ -7,12 +7,15 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/config"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes"
 | 
					 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
	"gopkg.in/yaml.v3"
 | 
						"gopkg.in/yaml.v3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/config"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes"
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const cacheVersion = "v0.1.0"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type Cache struct {
 | 
					type Cache struct {
 | 
				
			||||||
	Projects     []*projects.Project
 | 
						Projects     []*projects.Project
 | 
				
			||||||
	Aliases      []*ProjectAlias
 | 
						Aliases      []*ProjectAlias
 | 
				
			||||||
@@ -26,6 +29,7 @@ type Cache struct {
 | 
				
			|||||||
	file         string
 | 
						file         string
 | 
				
			||||||
	log          *pterm.Logger
 | 
						log          *pterm.Logger
 | 
				
			||||||
	path         string
 | 
						path         string
 | 
				
			||||||
 | 
						CacheVersion string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type CacheOpts struct {
 | 
					type CacheOpts struct {
 | 
				
			||||||
@@ -65,12 +69,11 @@ func (c *Cache) LockCache() {
 | 
				
			|||||||
	c.log.Info("Attempting to lock cache")
 | 
						c.log.Info("Attempting to lock cache")
 | 
				
			||||||
	c.checkLock()
 | 
						c.checkLock()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	file, err := os.OpenFile(c.file+".lock", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640)
 | 
						file, err := os.OpenFile(c.file+".lock", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o640)
 | 
				
			||||||
	defer file.Close()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		c.log.Fatal("Failed to lock cache", c.log.Args("error", err))
 | 
							c.log.Fatal("Failed to lock cache", c.log.Args("error", err))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						file.Close()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) checkLock() {
 | 
					func (c *Cache) checkLock() {
 | 
				
			||||||
@@ -81,7 +84,7 @@ func (c *Cache) checkLock() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Saves the current state of the cache to disk
 | 
					// Saves the current state of the cache to disk
 | 
				
			||||||
func (c *Cache) write() {
 | 
					func (c *Cache) write() {
 | 
				
			||||||
	file, err := os.OpenFile(c.file, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0640)
 | 
						file, err := os.OpenFile(c.file, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0o640)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		c.log.Error("Failed to write cache to disk", c.log.Args("error", err))
 | 
							c.log.Error("Failed to write cache to disk", c.log.Args("error", err))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -92,6 +95,7 @@ func (c *Cache) write() {
 | 
				
			|||||||
		c.log.Debug("Cache saved to disk")
 | 
							c.log.Debug("Cache saved to disk")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) Write() {
 | 
					func (c *Cache) Write() {
 | 
				
			||||||
	c.lock.Lock()
 | 
						c.lock.Lock()
 | 
				
			||||||
	defer c.lock.Unlock()
 | 
						defer c.lock.Unlock()
 | 
				
			||||||
@@ -117,6 +121,19 @@ func (c *Cache) Read() error {
 | 
				
			|||||||
	d := yaml.NewDecoder(file)
 | 
						d := yaml.NewDecoder(file)
 | 
				
			||||||
	d.Decode(c)
 | 
						d.Decode(c)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// Perform migrations
 | 
				
			||||||
 | 
						err, migrated := c.doMigrations()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							c.log.Error("Failed to run cache migrations",
 | 
				
			||||||
 | 
								c.log.Args(
 | 
				
			||||||
 | 
									"migrated", migrated,
 | 
				
			||||||
 | 
									"error", err,
 | 
				
			||||||
 | 
								))
 | 
				
			||||||
 | 
						} else if migrated > 0 {
 | 
				
			||||||
 | 
							c.log.Info("Migrations run successfully", c.log.Args(
 | 
				
			||||||
 | 
								"migrated", migrated))
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	c.readFromFile = true
 | 
						c.readFromFile = true
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -132,6 +149,7 @@ func (c *Cache) clear(clearAliases bool) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	c.setUpdated()
 | 
						c.setUpdated()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) Clear(clearAliases bool) {
 | 
					func (c *Cache) Clear(clearAliases bool) {
 | 
				
			||||||
	c.lock.Lock()
 | 
						c.lock.Lock()
 | 
				
			||||||
	defer c.lock.Unlock()
 | 
						defer c.lock.Unlock()
 | 
				
			||||||
@@ -148,7 +166,7 @@ func (c *Cache) refresh(remotes ...string) {
 | 
				
			|||||||
	c.LoadRemotes(remotes...)
 | 
						c.LoadRemotes(remotes...)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Iterates through all GitLab projects the user has access to, updating
 | 
					// Iterates through all Git projects the user has access to, updating
 | 
				
			||||||
// the project cache where necessary
 | 
					// the project cache where necessary
 | 
				
			||||||
func (c *Cache) Refresh(remotes ...string) {
 | 
					func (c *Cache) Refresh(remotes ...string) {
 | 
				
			||||||
	c.lock.Lock()
 | 
						c.lock.Lock()
 | 
				
			||||||
@@ -210,5 +228,5 @@ func NewProjectCache(opts *CacheOpts) (*Cache, error) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func createProjectCache(path string) error {
 | 
					func createProjectCache(path string) error {
 | 
				
			||||||
	return os.WriteFile(path, nil, 0640)
 | 
						return os.WriteFile(path, nil, 0o640)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										25
									
								
								internal/cache/cache_aliases.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										25
									
								
								internal/cache/cache_aliases.go
									
									
									
									
										vendored
									
									
								
							@@ -3,8 +3,9 @@ package cache
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) deleteAlias(alias *ProjectAlias) {
 | 
					func (c *Cache) deleteAlias(alias *ProjectAlias) {
 | 
				
			||||||
@@ -21,34 +22,35 @@ func (c *Cache) DeleteAlias(alias *ProjectAlias) {
 | 
				
			|||||||
	c.deleteAlias(alias)
 | 
						c.deleteAlias(alias)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) addAlias(alias string, projectID int, remote string) error {
 | 
					func (c *Cache) addAlias(alias string, project *projects.Project) error {
 | 
				
			||||||
	if c.GetAliasByName(alias) != nil {
 | 
						if c.GetAliasByName(alias) != nil {
 | 
				
			||||||
		return errors.New("Failed to add alias, already exists")
 | 
							return errors.New("failed to add alias, already exists")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	c.Aliases = append(c.Aliases,
 | 
						c.Aliases = append(c.Aliases,
 | 
				
			||||||
		&ProjectAlias{
 | 
							&ProjectAlias{
 | 
				
			||||||
			Alias:     alias,
 | 
								Alias:     alias,
 | 
				
			||||||
			ProjectID: projectID,
 | 
								ProjectID: project.ID,
 | 
				
			||||||
			Remote:    remote,
 | 
								ID:        project.GetID(),
 | 
				
			||||||
 | 
								Remote:    project.Remote,
 | 
				
			||||||
		})
 | 
							})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) AddAlias(alias string, projectID int, remote string) error {
 | 
					func (c *Cache) AddAlias(alias string, project *projects.Project) error {
 | 
				
			||||||
	c.lock.Lock()
 | 
						c.lock.Lock()
 | 
				
			||||||
	defer c.lock.Unlock()
 | 
						defer c.lock.Unlock()
 | 
				
			||||||
	return c.addAlias(alias, projectID, remote)
 | 
						return c.addAlias(alias, project)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) GetProjectsWithAliases() []*projects.Project {
 | 
					func (c *Cache) GetProjectsWithAliases() []*projects.Project {
 | 
				
			||||||
	projectList := make([]*projects.Project, 0)
 | 
						projectList := make([]*projects.Project, 0)
 | 
				
			||||||
	projectsFound := make([]int, 0)
 | 
						projectsFound := make([]string, 0)
 | 
				
			||||||
	for _, a := range c.Aliases {
 | 
						for _, a := range c.Aliases {
 | 
				
			||||||
		if !slices.Contains(projectsFound, a.ProjectID) {
 | 
							if !slices.Contains(projectsFound, a.ID) {
 | 
				
			||||||
			projectList = append(projectList, c.GetProjectByAlias(a))
 | 
								projectList = append(projectList, c.GetProjectByAlias(a))
 | 
				
			||||||
			projectsFound = append(projectsFound, a.ProjectID)
 | 
								projectsFound = append(projectsFound, a.ID)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return projectList
 | 
						return projectList
 | 
				
			||||||
@@ -67,12 +69,13 @@ func (c *Cache) setAliasRemotes() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) setAliasRemote(alias *ProjectAlias) {
 | 
					func (c *Cache) setAliasRemote(alias *ProjectAlias) {
 | 
				
			||||||
	project := c.GetProjectByID(alias.ProjectID)
 | 
						project := c.GetProjectByID(alias.ID)
 | 
				
			||||||
	if project != nil {
 | 
						if project != nil {
 | 
				
			||||||
		alias.Remote = project.Remote
 | 
							alias.Remote = project.Remote
 | 
				
			||||||
		c.log.Debug("Fixed missing alias remote", c.log.Args(
 | 
							c.log.Debug("Fixed missing alias remote", c.log.Args(
 | 
				
			||||||
			"alias", alias.Alias,
 | 
								"alias", alias.Alias,
 | 
				
			||||||
			"projectID", alias.ProjectID,
 | 
								"projectID", alias.ProjectID,
 | 
				
			||||||
 | 
								"ID", alias.ID,
 | 
				
			||||||
			"remote", alias.Remote,
 | 
								"remote", alias.Remote,
 | 
				
			||||||
		))
 | 
							))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								internal/cache/cache_load.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								internal/cache/cache_load.go
									
									
									
									
										vendored
									
									
								
							@@ -5,9 +5,9 @@ import (
 | 
				
			|||||||
	"sync"
 | 
						"sync"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/load"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -22,7 +22,7 @@ func (c *Cache) LoadRemotes(gitRemotes ...string) {
 | 
				
			|||||||
			c.log.Error("Skipping load of remote, not alive", c.log.Args(
 | 
								c.log.Error("Skipping load of remote, not alive", c.log.Args(
 | 
				
			||||||
				"remote", r.String()))
 | 
									"remote", r.String()))
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		} else if !slices.Contains(gitRemotes, r.GetInfo().Host) {
 | 
							} else if len(gitRemotes) > 0 && !slices.Contains(gitRemotes, r.GetInfo().Host) {
 | 
				
			||||||
			c.log.Debug("Skipping remote not in --remote list", c.log.Args(
 | 
								c.log.Debug("Skipping remote not in --remote list", c.log.Args(
 | 
				
			||||||
				"remote", r.String(),
 | 
									"remote", r.String(),
 | 
				
			||||||
				"remotes", gitRemotes))
 | 
									"remotes", gitRemotes))
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										78
									
								
								internal/cache/cache_migrations.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								internal/cache/cache_migrations.go
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,78 @@
 | 
				
			|||||||
 | 
					package cache
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"errors"
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"golang.org/x/mod/semver"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Migrations funcs should return errors along with
 | 
				
			||||||
 | 
					// number of records updated
 | 
				
			||||||
 | 
					type migrationFunc func(c *Cache) (error, int)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Registry of migrations by version
 | 
				
			||||||
 | 
					var migrations = map[string]map[string]migrationFunc{
 | 
				
			||||||
 | 
						"v0.1.0": {
 | 
				
			||||||
 | 
							"Make Aliases Unique": v010_aliases,
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Performs any required updates based on version
 | 
				
			||||||
 | 
					// of cache read from disk.
 | 
				
			||||||
 | 
					// Does not check to ensure migrations were successful,
 | 
				
			||||||
 | 
					// only checks if a version has been achieved
 | 
				
			||||||
 | 
					func (c *Cache) DoMigrations() (error, int) {
 | 
				
			||||||
 | 
						c.lock.Lock()
 | 
				
			||||||
 | 
						defer c.lock.Unlock()
 | 
				
			||||||
 | 
						return c.doMigrations()
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (c *Cache) doMigrations() (error, int) {
 | 
				
			||||||
 | 
						var errs error
 | 
				
			||||||
 | 
						var migrated int
 | 
				
			||||||
 | 
						for version, migrationFuncs := range migrations {
 | 
				
			||||||
 | 
							var funcMigrated int
 | 
				
			||||||
 | 
							if semver.Compare(c.CacheVersion, version) < 0 {
 | 
				
			||||||
 | 
								for name, migration := range migrationFuncs {
 | 
				
			||||||
 | 
									err, numMigrated := migration(c)
 | 
				
			||||||
 | 
									if err != nil {
 | 
				
			||||||
 | 
										errs = errors.Join(
 | 
				
			||||||
 | 
											errs,
 | 
				
			||||||
 | 
											fmt.Errorf("%s - %s: %w", version, name, err),
 | 
				
			||||||
 | 
										)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									funcMigrated += numMigrated
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								// We've reached a cache version, update the CacheVersion
 | 
				
			||||||
 | 
								// and write to disk
 | 
				
			||||||
 | 
								if errs == nil && funcMigrated > 0 {
 | 
				
			||||||
 | 
									c.CacheVersion = version
 | 
				
			||||||
 | 
									c.write()
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							migrated += funcMigrated
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return errs, migrated
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func v010_aliases(c *Cache) (error, int) {
 | 
				
			||||||
 | 
						var aliasesMigrated int
 | 
				
			||||||
 | 
						var errs error
 | 
				
			||||||
 | 
						for i, a := range c.Aliases {
 | 
				
			||||||
 | 
							if a.ID == "" {
 | 
				
			||||||
 | 
								if a.Remote == "" {
 | 
				
			||||||
 | 
									errs = errors.Join(errs,
 | 
				
			||||||
 | 
										fmt.Errorf("alias %s [id:%d] has no remote", a.Alias, a.ProjectID))
 | 
				
			||||||
 | 
									continue
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								c.Aliases[i].ID = projects.MakeID(a.Remote, a.ProjectID)
 | 
				
			||||||
 | 
								aliasesMigrated++
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return errs, aliasesMigrated
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
							
								
								
									
										2
									
								
								internal/cache/cache_projects.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								internal/cache/cache_projects.go
									
									
									
									
										vendored
									
									
								
							@@ -4,7 +4,7 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										16
									
								
								internal/cache/fuzz.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										16
									
								
								internal/cache/fuzz.go
									
									
									
									
										vendored
									
									
								
							@@ -4,7 +4,9 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/lithammer/fuzzysearch/fuzzy"
 | 
						"github.com/lithammer/fuzzysearch/fuzzy"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Performs a fuzzy find on the input string, returning the closest
 | 
					// Performs a fuzzy find on the input string, returning the closest
 | 
				
			||||||
@@ -27,14 +29,16 @@ func (c *Cache) FuzzyFindAlias(name string) []*ProjectAlias {
 | 
				
			|||||||
		c.log.Debug("Fuzzy found multiple aliases, try being more specific",
 | 
							c.log.Debug("Fuzzy found multiple aliases, try being more specific",
 | 
				
			||||||
			c.log.Args("foundAliases", strings.Join(found, ", ")))
 | 
								c.log.Args("foundAliases", strings.Join(found, ", ")))
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	var aliases []*ProjectAlias
 | 
						aliases := make([]*ProjectAlias, 0, ranks.Len())
 | 
				
			||||||
	if ranks.Len() > 0 {
 | 
						if ranks.Len() > 0 {
 | 
				
			||||||
		aliases = make([]*ProjectAlias, ranks.Len())
 | 
							for _, r := range ranks {
 | 
				
			||||||
		for i, r := range ranks {
 | 
								alias := c.GetAliasByName(r.Target)
 | 
				
			||||||
			aliases[i] = c.GetAliasByName(r.Target)
 | 
								if alias != nil {
 | 
				
			||||||
 | 
									aliases = append(aliases, alias)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return aliases
 | 
						return slices.Clip(aliases)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Returns all matching projects by fuzzy find term
 | 
					// Returns all matching projects by fuzzy find term
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								internal/cache/projects.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								internal/cache/projects.go
									
									
									
									
										vendored
									
									
								
							@@ -4,8 +4,9 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) ProjectString(p *projects.Project) string {
 | 
					func (c *Cache) ProjectString(p *projects.Project) string {
 | 
				
			||||||
@@ -60,9 +61,9 @@ func (c *Cache) GetProjectByRemoteAndId(remote string, id int) *projects.Project
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) GetProjectByID(id int) *projects.Project {
 | 
					func (c *Cache) GetProjectByID(id string) *projects.Project {
 | 
				
			||||||
	for _, p := range c.Projects {
 | 
						for _, p := range c.Projects {
 | 
				
			||||||
		if p.ID == id {
 | 
							if p.GetID() == id {
 | 
				
			||||||
			return p
 | 
								return p
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										17
									
								
								internal/cache/projects_alias.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								internal/cache/projects_alias.go
									
									
									
									
										vendored
									
									
								
							@@ -7,13 +7,15 @@ import (
 | 
				
			|||||||
	"text/tabwriter"
 | 
						"text/tabwriter"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					 | 
				
			||||||
	"golang.org/x/exp/slices"
 | 
						"golang.org/x/exp/slices"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type ProjectAlias struct {
 | 
					type ProjectAlias struct {
 | 
				
			||||||
	Alias     string
 | 
						Alias     string
 | 
				
			||||||
	ProjectID int
 | 
						ProjectID int
 | 
				
			||||||
 | 
						ID        string
 | 
				
			||||||
	Remote    string
 | 
						Remote    string
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -27,6 +29,9 @@ func (c *Cache) GetProjectAliasStrings(project *projects.Project) []string {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) GetProjectStringWithAliases(project *projects.Project) string {
 | 
					func (c *Cache) GetProjectStringWithAliases(project *projects.Project) string {
 | 
				
			||||||
 | 
						if project == nil {
 | 
				
			||||||
 | 
							return ""
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	aliases := c.GetProjectAliasStrings(project)
 | 
						aliases := c.GetProjectAliasStrings(project)
 | 
				
			||||||
	return fmt.Sprintf("%s (%s) -> %s",
 | 
						return fmt.Sprintf("%s (%s) -> %s",
 | 
				
			||||||
		project.Name,
 | 
							project.Name,
 | 
				
			||||||
@@ -93,7 +98,7 @@ func (c *Cache) GetProjectByAlias(alias *ProjectAlias) *projects.Project {
 | 
				
			|||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	for _, p := range c.Projects {
 | 
						for _, p := range c.Projects {
 | 
				
			||||||
		if p.ID == alias.ProjectID && p.Remote == alias.Remote {
 | 
							if p.GetID() == alias.ID {
 | 
				
			||||||
			return p
 | 
								return p
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -102,9 +107,11 @@ func (c *Cache) GetProjectByAlias(alias *ProjectAlias) *projects.Project {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *Cache) GetProjectAliases(project *projects.Project) []*ProjectAlias {
 | 
					func (c *Cache) GetProjectAliases(project *projects.Project) []*ProjectAlias {
 | 
				
			||||||
	aliases := make([]*ProjectAlias, 0)
 | 
						aliases := make([]*ProjectAlias, 0)
 | 
				
			||||||
	for _, alias := range c.Aliases {
 | 
						if project != nil {
 | 
				
			||||||
		if alias.ProjectID == project.ID {
 | 
							for _, alias := range c.Aliases {
 | 
				
			||||||
			aliases = append(aliases, alias)
 | 
								if alias.ProjectID == project.ID {
 | 
				
			||||||
 | 
									aliases = append(aliases, alias)
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return aliases
 | 
						return aliases
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11
									
								
								internal/cache/projects_fs.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								internal/cache/projects_fs.go
									
									
									
									
										vendored
									
									
								
							@@ -6,7 +6,7 @@ import (
 | 
				
			|||||||
	"path/filepath"
 | 
						"path/filepath"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) GoTo(project *projects.Project) {
 | 
					func (c *Cache) GoTo(project *projects.Project) {
 | 
				
			||||||
@@ -32,7 +32,7 @@ func (c *Cache) GetProjectFromCwd() (*projects.Project, error) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return project, err
 | 
							return project, err
 | 
				
			||||||
	} else if !strings.HasPrefix(cwd, c.path) {
 | 
						} else if !strings.HasPrefix(cwd, c.path) {
 | 
				
			||||||
		return project, errors.New("Not in any project path")
 | 
							return project, errors.New("not in any project path")
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Strip projects dir from path
 | 
						// Strip projects dir from path
 | 
				
			||||||
@@ -48,14 +48,11 @@ func (c *Cache) GetProjectFromCwd() (*projects.Project, error) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (c *Cache) IsProjectCloned(p *projects.Project) bool {
 | 
					func (c *Cache) IsProjectCloned(p *projects.Project) bool {
 | 
				
			||||||
	_, err := os.Stat(c.GetProjectPath(p) + "/.git")
 | 
						_, err := os.Stat(c.GetProjectPath(p) + "/.git")
 | 
				
			||||||
	if err == nil {
 | 
						return err == nil
 | 
				
			||||||
		return true
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return false
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (c *Cache) PrepProjectPath(path string) {
 | 
					func (c *Cache) PrepProjectPath(path string) {
 | 
				
			||||||
	if err := os.MkdirAll(path, 0750); err != nil {
 | 
						if err := os.MkdirAll(path, 0o750); err != nil {
 | 
				
			||||||
		c.log.Fatal("Failed to prepare project path", c.log.Args(
 | 
							c.log.Fatal("Failed to prepare project path", c.log.Args(
 | 
				
			||||||
			"path", path,
 | 
								"path", path,
 | 
				
			||||||
			"error", err,
 | 
								"error", err,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										5
									
								
								internal/cache/projects_git.go
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								internal/cache/projects_git.go
									
									
									
									
										vendored
									
									
								
							@@ -5,7 +5,8 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	git "github.com/go-git/go-git/v5"
 | 
						git "github.com/go-git/go-git/v5"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					
 | 
				
			||||||
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const gitCloneTimeoutSecs = 60
 | 
					const gitCloneTimeoutSecs = 60
 | 
				
			||||||
@@ -31,7 +32,7 @@ func (c *Cache) OpenProject(ctx context.Context, project *projects.Project) *git
 | 
				
			|||||||
		// Check to make sure we can connect before we time out
 | 
							// Check to make sure we can connect before we time out
 | 
				
			||||||
		// shouldn't be necessary, but go-git does not properly
 | 
							// shouldn't be necessary, but go-git does not properly
 | 
				
			||||||
		// honor its context
 | 
							// honor its context
 | 
				
			||||||
		if err := project.CheckHost(projects.GitProtoSSH); err != nil {
 | 
							if err = project.CheckHost(projects.GitProtoSSH); err != nil {
 | 
				
			||||||
			c.log.Fatal("Git remote unreachable, giving up", c.log.Args("error", err))
 | 
								c.log.Fatal("Git remote unreachable, giving up", c.log.Args("error", err))
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ package config
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type Config struct {
 | 
					type Config struct {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,9 +2,10 @@ package gitearemote
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
						"net/url"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/sdk/gitea"
 | 
						"code.gitea.io/sdk/gitea"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type GiteaRemote struct {
 | 
					type GiteaRemote struct {
 | 
				
			||||||
@@ -25,19 +26,27 @@ func (r *GiteaRemote) String() string {
 | 
				
			|||||||
		r.GetInfo().Name, r.GetInfo().Host, r.GetInfo().CloneProto)
 | 
							r.GetInfo().Name, r.GetInfo().Host, r.GetInfo().CloneProto)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewGiteaRemote(remoteInfo *info.RemoteInfo) (*GiteaRemote, error) {
 | 
					// Prepares the Gitea api client
 | 
				
			||||||
	client, err := gitea.NewClient(remoteInfo.Host,
 | 
					func (r *GiteaRemote) setClient() error {
 | 
				
			||||||
		gitea.SetContext(remoteInfo.Context()),
 | 
						var err error
 | 
				
			||||||
		gitea.SetToken(remoteInfo.Token),
 | 
						if r.api == nil {
 | 
				
			||||||
	)
 | 
							r.api, err = gitea.NewClient(r.info.Host,
 | 
				
			||||||
 | 
								gitea.SetContext(r.info.Context()),
 | 
				
			||||||
 | 
								gitea.SetToken(r.info.Token),
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return err
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err != nil {
 | 
					// Does not prepare the client due to the Gitea client making an initial
 | 
				
			||||||
 | 
					// http connection. API client to be set on-demand
 | 
				
			||||||
 | 
					func NewGiteaRemote(remoteInfo *info.RemoteInfo) (*GiteaRemote, error) {
 | 
				
			||||||
 | 
						if _, err := url.Parse(remoteInfo.Host); err != nil {
 | 
				
			||||||
		return nil, err
 | 
							return nil, err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	giteaRemote := &GiteaRemote{
 | 
						giteaRemote := &GiteaRemote{
 | 
				
			||||||
		info: remoteInfo,
 | 
							info: remoteInfo,
 | 
				
			||||||
		api:  client,
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return giteaRemote, nil
 | 
						return giteaRemote, nil
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,8 +7,8 @@ import (
 | 
				
			|||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/sdk/gitea"
 | 
						"code.gitea.io/sdk/gitea"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (r *GiteaRemote) ReposToProjects(repos []*gitea.Repository) []*projects.Project {
 | 
					func (r *GiteaRemote) ReposToProjects(repos []*gitea.Repository) []*projects.Project {
 | 
				
			||||||
@@ -75,6 +75,7 @@ func GetOwnerRepo(fullName string) (string, string) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
func (r *GiteaRemote) GetNumProjects(opts *remote.RemoteQueryOpts) int {
 | 
					func (r *GiteaRemote) GetNumProjects(opts *remote.RemoteQueryOpts) int {
 | 
				
			||||||
	var projects int
 | 
						var projects int
 | 
				
			||||||
 | 
						r.setClient()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	_, resp, err := r.api.SearchRepos(gitea.SearchRepoOptions{ListOptions: gitea.ListOptions{PageSize: 1}})
 | 
						_, resp, err := r.api.SearchRepos(gitea.SearchRepoOptions{ListOptions: gitea.ListOptions{PageSize: 1}})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,8 +4,8 @@ import (
 | 
				
			|||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/sdk/gitea"
 | 
						"code.gitea.io/sdk/gitea"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/load"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const giteaReposPerPage = 20
 | 
					const giteaReposPerPage = 20
 | 
				
			||||||
@@ -13,6 +13,7 @@ const giteaReposPerPage = 20
 | 
				
			|||||||
func (r *GiteaRemote) StreamProjects(pi *load.ProgressInfo, opts *remote.RemoteQueryOpts) {
 | 
					func (r *GiteaRemote) StreamProjects(pi *load.ProgressInfo, opts *remote.RemoteQueryOpts) {
 | 
				
			||||||
	defer close(pi.ProgressChan)
 | 
						defer close(pi.ProgressChan)
 | 
				
			||||||
	defer close(pi.ProjectsChan)
 | 
						defer close(pi.ProjectsChan)
 | 
				
			||||||
 | 
						r.setClient()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Get projects. TODO support concurrency
 | 
						// Get projects. TODO support concurrency
 | 
				
			||||||
	giteaListOpts := gitea.ListOptions{Page: 1, PageSize: giteaReposPerPage}
 | 
						giteaListOpts := gitea.ListOptions{Page: 1, PageSize: giteaReposPerPage}
 | 
				
			||||||
@@ -36,7 +37,7 @@ func (r *GiteaRemote) StreamProjects(pi *load.ProgressInfo, opts *remote.RemoteQ
 | 
				
			|||||||
			TotalProjects: pi.NumProjects,
 | 
								TotalProjects: pi.NumProjects,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if resp.LastPage == resp.NextPage {
 | 
							if resp.NextPage == 0 {
 | 
				
			||||||
			break
 | 
								break
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/google/go-github/v58/github"
 | 
						"github.com/google/go-github/v58/github"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type GithubRemote struct {
 | 
					type GithubRemote struct {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,8 +4,8 @@ import (
 | 
				
			|||||||
	"math"
 | 
						"math"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/google/go-github/v58/github"
 | 
						"github.com/google/go-github/v58/github"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (r *GithubRemote) GetNumProjects(opts *remote.RemoteQueryOpts) int {
 | 
					func (r *GithubRemote) GetNumProjects(opts *remote.RemoteQueryOpts) int {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,8 +4,8 @@ import (
 | 
				
			|||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/google/go-github/v58/github"
 | 
						"github.com/google/go-github/v58/github"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/load"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const githubReposPerPage = 20
 | 
					const githubReposPerPage = 20
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,7 +4,7 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/xanzy/go-gitlab"
 | 
						"github.com/xanzy/go-gitlab"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type GitlabRemote struct {
 | 
					type GitlabRemote struct {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,9 +5,9 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	"github.com/pterm/pterm"
 | 
						"github.com/pterm/pterm"
 | 
				
			||||||
	"github.com/xanzy/go-gitlab"
 | 
						"github.com/xanzy/go-gitlab"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var DefaultListOpts = &gitlab.ListProjectsOptions{
 | 
					var DefaultListOpts = &gitlab.ListProjectsOptions{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4,8 +4,8 @@ import (
 | 
				
			|||||||
	"sync"
 | 
						"sync"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/xanzy/go-gitlab"
 | 
						"github.com/xanzy/go-gitlab"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/load"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Will determine number of total projects,
 | 
					// Will determine number of total projects,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
package load
 | 
					package load
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import "gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
					import "gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// This package provides structs that serve
 | 
					// This package provides structs that serve
 | 
				
			||||||
// as the interface between remotes, and any code
 | 
					// as the interface between remotes, and any code
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
package projects
 | 
					package projects
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						"crypto/sha1"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
@@ -8,6 +9,8 @@ import (
 | 
				
			|||||||
	"github.com/go-git/go-git/v5"
 | 
						"github.com/go-git/go-git/v5"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Git project metadata
 | 
				
			||||||
 | 
					// Do not use Project.ID directly (remotes may conflict), use Project.GetID()
 | 
				
			||||||
type Project struct {
 | 
					type Project struct {
 | 
				
			||||||
	ID                int
 | 
						ID                int
 | 
				
			||||||
	Description       string
 | 
						Description       string
 | 
				
			||||||
@@ -35,8 +38,7 @@ type ProjectLanguage struct {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func NewProjectLanguages() *ProjectLanguages {
 | 
					func NewProjectLanguages() *ProjectLanguages {
 | 
				
			||||||
	var pLangs ProjectLanguages
 | 
						var pLangs ProjectLanguages = make([]*ProjectLanguage, 0)
 | 
				
			||||||
	pLangs = make([]*ProjectLanguage, 0)
 | 
					 | 
				
			||||||
	return &pLangs
 | 
						return &pLangs
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -44,6 +46,32 @@ func (pl *ProjectLanguages) AddLanguage(lang *ProjectLanguage) {
 | 
				
			|||||||
	*pl = append(*pl, lang)
 | 
						*pl = append(*pl, lang)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Gets a unique ID using a short-sha of the http repo
 | 
				
			||||||
 | 
					// along with the numerical ID of the project.
 | 
				
			||||||
 | 
					// Uses SSH URL and then Remote if previous is empty
 | 
				
			||||||
 | 
					func (p *Project) GetID() string {
 | 
				
			||||||
 | 
						return fmt.Sprintf("%s||%d", p.GetRemoteSha(), p.ID)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func MakeID(remote string, projectID int) string {
 | 
				
			||||||
 | 
						return fmt.Sprintf("%s||%d", GetRemoteSha(remote), projectID)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (p *Project) GetRemoteSha() string {
 | 
				
			||||||
 | 
						remote := p.Remote
 | 
				
			||||||
 | 
						if remote == "" && p.HTTPURLToRepo != "" {
 | 
				
			||||||
 | 
							remote = p.HTTPURLToRepo
 | 
				
			||||||
 | 
						} else if remote == "" && p.WebURL != "" {
 | 
				
			||||||
 | 
							remote = p.WebURL
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return GetRemoteSha(remote)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func GetRemoteSha(remote string) string {
 | 
				
			||||||
 | 
						return fmt.Sprintf("%x", sha1.Sum([]byte(remote)))[:12]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (p *Project) String() string {
 | 
					func (p *Project) String() string {
 | 
				
			||||||
	var projectString string
 | 
						var projectString string
 | 
				
			||||||
	if p != nil {
 | 
						if p != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@ func (p *Project) GetGitInfo() string {
 | 
				
			|||||||
	commit, _ := repo.CommitObject(head.Hash())
 | 
						commit, _ := repo.CommitObject(head.Hash())
 | 
				
			||||||
	str += "\n" + commit.String()
 | 
						str += "\n" + commit.String()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	str += pterm.LightMagenta("GitLab: ") + pterm.Bold.Sprint(p.HTTPURLToRepo) + "\n"
 | 
						str += pterm.LightMagenta("Git: ") + pterm.Bold.Sprint(p.HTTPURLToRepo) + "\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if remotes, _ := repo.Remotes(); len(remotes) > 0 {
 | 
						if remotes, _ := repo.Remotes(); len(remotes) > 0 {
 | 
				
			||||||
		str += pterm.LightBlue("Remote: ") + pterm.Bold.Sprint(remotes[0].Config().URLs[0])
 | 
							str += pterm.LightBlue("Remote: ") + pterm.Bold.Sprint(remotes[0].Config().URLs[0])
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,9 +20,7 @@ const (
 | 
				
			|||||||
	GitProtoHTTP
 | 
						GitProtoHTTP
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					var ErrUnknownHost error = errors.New("no addresses found for host")
 | 
				
			||||||
	ErrUnknownHost error = errors.New("No addresses found for host")
 | 
					 | 
				
			||||||
)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (p *Project) CheckHost(proto GitProto) error {
 | 
					func (p *Project) CheckHost(proto GitProto) error {
 | 
				
			||||||
	switch proto {
 | 
						switch proto {
 | 
				
			||||||
@@ -31,7 +29,7 @@ func (p *Project) CheckHost(proto GitProto) error {
 | 
				
			|||||||
	case GitProtoSSH:
 | 
						case GitProtoSSH:
 | 
				
			||||||
		return p.checkSSHRemote()
 | 
							return p.checkSSHRemote()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return errors.New("Unknown git protocol")
 | 
						return errors.New("unknown git protocol")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (p *Project) checkHTTPRemote() error {
 | 
					func (p *Project) checkHTTPRemote() error {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,8 +6,8 @@ import (
 | 
				
			|||||||
	"net/url"
 | 
						"net/url"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/info"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/info"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/load"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const defNetDialTimeoutSecs = 3
 | 
					const defNetDialTimeoutSecs = 3
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,9 +3,9 @@ package remotes
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"errors"
 | 
						"errors"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/load"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/load"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/projects"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/projects"
 | 
				
			||||||
	"gitlab.sweetwater.com/it/devops/tools/gitlab-project-manager/internal/remotes/remote"
 | 
						"gitea.libretechconsulting.com/rmcguire/git-project-manager/internal/remotes/remote"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Will determine number of total projects,
 | 
					// Will determine number of total projects,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user