mirror of https://gitea.com/gitea/tea.git
Compare commits
138 Commits
Author | SHA1 | Date |
---|---|---|
Renovate Bot | 115f25e85f | |
Renovate Bot | 656d48ec8d | |
Renovate Bot | 2cb450401c | |
techknowlogick | 5236a89d4c | |
techknowlogick | 48d2997a63 | |
techknowlogick | 75a7d4b7cc | |
techknowlogick | 1e3043ce6f | |
techknowlogick | 218b991069 | |
techknowlogick | 16a3594474 | |
techknowlogick | b1b31da7c8 | |
Lunny Xiao | 36672485d1 | |
Renovate Bot | 4fedaaafe1 | |
Renovate Bot | 6ae3718574 | |
Renovate Bot | c4f6231c49 | |
Renovate Bot | 76f7f901fc | |
Renovate Bot | 005beca233 | |
Renovate Bot | e62713f42a | |
John Olheiser | c8c8e9758b | |
Renovate Bot | d15af88f83 | |
Renovate Bot | c74177556b | |
Renovate Bot | 02836d8e52 | |
Konstantin Podsvirov | b8ad55117a | |
Renovate Bot | fb4eb8be9c | |
Renovate Bot | 81b784d7a5 | |
Renovate Bot | 649b0b1272 | |
Renovate Bot | 3c9552c531 | |
techknowlogick | f28ddccd90 | |
Renovate Bot | 5beb5bf56b | |
Renovate Bot | 17e09a3c2d | |
Renovate Bot | 58962cbb65 | |
Renovate Bot | 7029e7e8c5 | |
Renovate Bot | 3e8047dfe6 | |
techknowlogick | 897dc50bfe | |
Renovate Bot | 2f1ca85b25 | |
Lunny Xiao | e6a6aa6f49 | |
Renovate Bot | bcda543bb8 | |
Sienna Lloyd | 9e5db56dcf | |
techknowlogick | 92d49e383d | |
techknowlogick | 2a666c84cb | |
techknowlogick | 32b9f5e836 | |
techknowlogick | 33442fd05f | |
Renovate Bot | f2cf5b7979 | |
techknowlogick | d80c8ceffd | |
Renovate Bot | e3b4d68af7 | |
techknowlogick | 0df93dd47a | |
jolheiser | 66b4decdd1 | |
techknowlogick | 9e1919ec0a | |
Renovate Bot | 615cd31eb2 | |
techknowlogick | b868d30434 | |
Renovate Bot | 2d57e07dc7 | |
Renovate Bot | 3343fedc17 | |
Renovate Bot | f9c67f35a6 | |
Renovate Bot | dd8d7fb30f | |
Renovate Bot | 17453fd7cb | |
Renovate Bot | fe4551142a | |
mvaldes14 | 10bd00d066 | |
jolheiser | 0869c15a6c | |
Martin Veldwijk | e4e8eb07d2 | |
John Olheiser | 620f236723 | |
Martin Veldwijk | 77837e909e | |
6543 | 5582f92df4 | |
vsysoev | c72c6c0679 | |
Grady Wong | b2d845b8c7 | |
Bo-Yi Wu | 07039b82e3 | |
appleboy | 7040c350ae | |
appleboy | b02263adb0 | |
appleboy | 4915862b95 | |
appleboy | cd6a7b35c3 | |
ASDFGamer | abcaa58312 | |
ASDFGamer | d9da952e96 | |
Lunny Xiao | 7f335a2b9c | |
6543 | b510756438 | |
techknowlogick | 3640bbac5e | |
techknowlogick | b705188599 | |
6543 | cfce25f0a7 | |
6543 | e783f4ea4a | |
John Olheiser | 342b573d45 | |
Lunny Xiao | 1a6d9b343a | |
techknowlogick | faa9858a7e | |
techknowlogick | e51eb1a00e | |
Wim | 6a848cb72a | |
Norwin | 2a8c1daa67 | |
6543 | 54b535a527 | |
6543 | c1c7870ceb | |
6543 | a37377d181 | |
6543 | 15457f1770 | |
Norwin | 4487213581 | |
Wim | 6a4ba6a689 | |
6543 | 4ee5ce4b52 | |
6543 | 6c9b2f8745 | |
Norwin | 1a256291dc | |
techknowlogick | 832136b6d4 | |
Norwin | 99e49991bb | |
Norwin | bbb287e29e | |
Norwin | 5e7c702e07 | |
Norwin | b8dbf899d2 | |
Norwin | 0b8be54186 | |
Norwin | 2b1bca9e5d | |
Norwin | d5a258213d | |
6543 | f83f579dea | |
6543 | 65535bd948 | |
Sandro | 02f5f15269 | |
Norwin | 883a27b14e | |
6543 | e54b32493d | |
Norwin | 329200b1ef | |
Norwin | 6663d9f19b | |
6543 | d06f35482e | |
Norwin | 9ab36c55fa | |
6543 | 40e606561f | |
Norwin | 0970b94552 | |
Norwin | dda94a5dea | |
Norwin | 16ba594a28 | |
Norwin | d8f4273ed0 | |
Norwin | 637e3f0666 | |
techknowlogick | ced24ccabb | |
arkamar | fb3e1f75e9 | |
Lunny Xiao | 0e24009fe9 | |
arkamar | cd24fd8e28 | |
Ikko Ashimine | dd300c1269 | |
kellya | 44c9e7e664 | |
Norwin | 268aa06179 | |
Norwin | a7d83ee416 | |
Norwin | a89f51f9ec | |
Norwin | d2295828d0 | |
Norwin | dc16643e0d | |
Norwin | ac25e89ebf | |
Norwin | 819cc1ab21 | |
Norwin | 78a95f1ca4 | |
Norwin | 5b77345b03 | |
Norwin | 23ce7b351d | |
Norwin | 375ece06d2 | |
techknowlogick | 4ffd994549 | |
Norwin | 58aaa17e7e | |
Norwin | 7a05be436c | |
justusbunsi | 3cf084cb96 | |
Norwin | 1e59dee685 | |
justusbunsi | 42e423470c | |
Norwin | 555f1ae516 |
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "Tea DevContainer",
|
||||
"image": "mcr.microsoft.com/devcontainers/go:1.21-bullseye",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/git-lfs:1.1.0": {}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"settings": {},
|
||||
"extensions": [
|
||||
"editorconfig.editorconfig",
|
||||
"golang.go",
|
||||
"stylelint.vscode-stylelint",
|
||||
"DavidAnson.vscode-markdownlint",
|
||||
"ms-azuretools.vscode-docker",
|
||||
"GitHub.vscode-pull-request-github"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
Dockerfile
|
||||
tea
|
189
.drone.yml
189
.drone.yml
|
@ -1,189 +0,0 @@
|
|||
---
|
||||
kind: pipeline
|
||||
name: default
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: build
|
||||
pull: always
|
||||
image: golang:1.16
|
||||
environment:
|
||||
GOPROXY: https://goproxy.cn
|
||||
commands:
|
||||
- make clean
|
||||
- make vet
|
||||
- make lint
|
||||
- make fmt-check
|
||||
- make misspell-check
|
||||
- make test-vendor
|
||||
- make build
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
- pull_request
|
||||
|
||||
- name: unit-test
|
||||
image: golang:1.16
|
||||
commands:
|
||||
- make unit-test-coverage
|
||||
settings:
|
||||
group: test
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
- name: release-test
|
||||
image: golang:1.16
|
||||
commands:
|
||||
- make test
|
||||
settings:
|
||||
group: test
|
||||
when:
|
||||
branch:
|
||||
- "release/*"
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
- name: tag-test
|
||||
pull: always
|
||||
image: golang:1.16
|
||||
commands:
|
||||
- make test
|
||||
settings:
|
||||
group: test
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: static
|
||||
image: golang:1.16
|
||||
environment:
|
||||
GOPROXY: https://goproxy.cn
|
||||
commands:
|
||||
- export PATH=$PATH:$GOPATH/bin
|
||||
- make release
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
|
||||
- name: gpg-sign
|
||||
pull: always
|
||||
image: plugins/gpgsign:1
|
||||
settings:
|
||||
detach_sign: true
|
||||
excludes:
|
||||
- "dist/release/*.sha256"
|
||||
files:
|
||||
- "dist/release/*"
|
||||
environment:
|
||||
GPGSIGN_KEY:
|
||||
from_secret: gpgsign_key
|
||||
GPGSIGN_PASSPHRASE:
|
||||
from_secret: gpgsign_passphrase
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
|
||||
- name: tag-release
|
||||
pull: always
|
||||
image: plugins/s3:1
|
||||
settings:
|
||||
acl: public-read
|
||||
bucket: gitea-artifacts
|
||||
endpoint: https://storage.gitea.io
|
||||
path_style: true
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
target: "/tea/${DRONE_TAG##v}"
|
||||
environment:
|
||||
AWS_ACCESS_KEY_ID:
|
||||
from_secret: aws_access_key_id
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
from_secret: aws_secret_access_key
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: release-branch-release
|
||||
pull: always
|
||||
image: plugins/s3:1
|
||||
settings:
|
||||
acl: public-read
|
||||
bucket: gitea-artifacts
|
||||
endpoint: https://storage.gitea.io
|
||||
path_style: true
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
target: "/tea/${DRONE_BRANCH##release/v}"
|
||||
environment:
|
||||
AWS_ACCESS_KEY_ID:
|
||||
from_secret: aws_access_key_id
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
from_secret: aws_secret_access_key
|
||||
when:
|
||||
branch:
|
||||
- "release/*"
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: release
|
||||
pull: always
|
||||
image: plugins/s3:1
|
||||
settings:
|
||||
acl: public-read
|
||||
bucket: gitea-artifacts
|
||||
endpoint: https://storage.gitea.io
|
||||
path_style: true
|
||||
source: "dist/release/*"
|
||||
strip_prefix: dist/release/
|
||||
target: /tea/master
|
||||
environment:
|
||||
AWS_ACCESS_KEY_ID:
|
||||
from_secret: aws_access_key_id
|
||||
AWS_SECRET_ACCESS_KEY:
|
||||
from_secret: aws_secret_access_key
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
event:
|
||||
- push
|
||||
|
||||
- name: gitea
|
||||
pull: always
|
||||
image: plugins/gitea-release:1
|
||||
settings:
|
||||
files:
|
||||
- "dist/release/*"
|
||||
base_url: https://gitea.com
|
||||
api_key:
|
||||
from_secret: gitea_token
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
|
||||
- name: discord
|
||||
pull: always
|
||||
image: appleboy/drone-discord:1.0.0
|
||||
environment:
|
||||
DISCORD_WEBHOOK_ID:
|
||||
from_secret: discord_webhook_id
|
||||
DISCORD_WEBHOOK_TOKEN:
|
||||
from_secret: discord_webhook_token
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
- tag
|
||||
- pull_request
|
||||
status:
|
||||
- changed
|
||||
- failure
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
name: "Bug Report"
|
||||
about: "Use this template when reporting a bug, so you don't forget important information we'd ask for later."
|
||||
title: "Bug: "
|
||||
labels:
|
||||
- kind/bug
|
||||
---
|
||||
|
||||
### describe your environment
|
||||
- tea version used (`tea -v`):
|
||||
- [ ] I also reproduced the issue [with the latest master build](https://dl.gitea.com/tea/main/)
|
||||
- Gitea version used:
|
||||
- [ ] the issue only occurred after updating gitea recently
|
||||
- operating system:
|
||||
- I make use of...
|
||||
- [ ] non-standard default branch names (no `main`,`master`, or `trunk`)
|
||||
- [ ] .ssh/config or .gitconfig host aliases in my git remotes
|
||||
- [ ] ssh_agent or similar
|
||||
- [ ] non-standard ports for gitea and/or ssh
|
||||
- [ ] something else that's likely to interact badly with tea: ...
|
||||
|
||||
|
||||
Please provide the output of `git remote -v` (if the issue is related to tea not finding resources on Gitea):
|
||||
```
|
||||
|
||||
```
|
||||
|
||||
### describe the issue (observed vs expected behaviour)
|
||||
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
name: goreleaser
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: git fetch --force --tags
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '>=1.20.1'
|
||||
- name: import gpg
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
- name: goreleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
distribution: goreleaser-pro
|
||||
version: latest
|
||||
args: release --nightly
|
||||
env:
|
||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
S3_REGION: ${{ secrets.AWS_REGION }}
|
||||
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
|
||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||
GPGSIGN_PASSPHRASE: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
release-image:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_ORG: gitea
|
||||
DOCKER_LATEST: nightly
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # all history for all branches and tags
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
env:
|
||||
ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: |
|
||||
linux/amd64
|
||||
linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
gitea/tea:latest
|
|
@ -0,0 +1,42 @@
|
|||
name: goreleaser
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
goreleaser:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: git fetch --force --tags
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
- name: import gpg
|
||||
id: import_gpg
|
||||
uses: crazy-max/ghaction-import-gpg@v6
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
fingerprint: CC64B1DB67ABBEECAB24B6455FC346329753F4B0
|
||||
- name: goreleaser
|
||||
uses: goreleaser/goreleaser-action@v5
|
||||
with:
|
||||
distribution: goreleaser-pro
|
||||
version: latest
|
||||
args: release
|
||||
env:
|
||||
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
|
||||
AWS_REGION: ${{ secrets.AWS_REGION }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
S3_REGION: ${{ secrets.AWS_REGION }}
|
||||
S3_BUCKET: ${{ secrets.AWS_BUCKET }}
|
||||
GORELEASER_FORCE_TOKEN: 'gitea'
|
||||
GPGSIGN_PASSPHRASE: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
|
||||
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN }}
|
|
@ -0,0 +1,30 @@
|
|||
name: check-and-test
|
||||
|
||||
on:
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
check-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
- name: lint and build
|
||||
run: |
|
||||
make clean
|
||||
make vet
|
||||
make lint
|
||||
make fmt-check
|
||||
make misspell-check
|
||||
make docs-check
|
||||
make build
|
||||
env:
|
||||
GOPROXY: https://goproxy.io,direct
|
||||
- name: test and coverage
|
||||
run: |
|
||||
make test
|
||||
make unit-test-coverage
|
||||
env:
|
||||
GOPROXY: https://goproxy.io,direct
|
|
@ -1,8 +1,14 @@
|
|||
tea
|
||||
/gitea-vet
|
||||
/gitea-vet.exe
|
||||
|
||||
.idea/
|
||||
.history/
|
||||
dist/
|
||||
|
||||
.vscode/
|
||||
vendor/
|
||||
|
||||
coverage.out
|
||||
|
||||
dist/
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo "usage: $0 <path>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SUM=$(shasum -a 256 "$1" | cut -d' ' -f1)
|
||||
BASENAME=$(basename "$1")
|
||||
echo -n "${SUM} ${BASENAME}" > "$1".sha256
|
|
@ -0,0 +1,124 @@
|
|||
before:
|
||||
hooks:
|
||||
- go mod tidy
|
||||
|
||||
builds:
|
||||
- env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
- darwin
|
||||
- linux
|
||||
- windows
|
||||
- freebsd
|
||||
goarch:
|
||||
- amd64
|
||||
- arm
|
||||
- arm64
|
||||
goarm:
|
||||
- "5"
|
||||
- "6"
|
||||
- "7"
|
||||
ignore:
|
||||
- goos: darwin
|
||||
goarch: arm
|
||||
- goos: darwin
|
||||
goarch: ppc64le
|
||||
- goos: darwin
|
||||
goarch: s390x
|
||||
- goos: windows
|
||||
goarch: ppc64le
|
||||
- goos: windows
|
||||
goarch: s390x
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
goarm: "5"
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
goarm: "6"
|
||||
- goos: windows
|
||||
goarch: arm
|
||||
goarm: "7"
|
||||
- goos: windows
|
||||
goarch: arm64
|
||||
- goos: freebsd
|
||||
goarch: ppc64le
|
||||
- goos: freebsd
|
||||
goarch: s390x
|
||||
- goos: freebsd
|
||||
goarch: arm
|
||||
goarm: "5"
|
||||
- goos: freebsd
|
||||
goarch: arm
|
||||
goarm: "6"
|
||||
- goos: freebsd
|
||||
goarch: arm
|
||||
goarm: "7"
|
||||
- goos: freebsd
|
||||
goarch: arm64
|
||||
flags:
|
||||
- -trimpath
|
||||
ldflags:
|
||||
- -s -w -X main.Version={{ .Version }}
|
||||
binary: >-
|
||||
{{ .ProjectName }}-
|
||||
{{- .Version }}-
|
||||
{{- .Os }}-
|
||||
{{- if eq .Arch "amd64" }}amd64
|
||||
{{- else if eq .Arch "amd64_v1" }}amd64
|
||||
{{- else if eq .Arch "386" }}386
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
{{- if .Arm }}-{{ .Arm }}{{ end }}
|
||||
no_unique_dist_dir: true
|
||||
hooks:
|
||||
post:
|
||||
- cmd: xz -k -9 {{ .Path }}
|
||||
dir: ./dist/
|
||||
- cmd: sh .goreleaser.checksum.sh {{ .Path }}
|
||||
- cmd: sh .goreleaser.checksum.sh {{ .Path }}.xz
|
||||
|
||||
blobs:
|
||||
-
|
||||
provider: s3
|
||||
bucket: "{{ .Env.S3_BUCKET }}"
|
||||
region: "{{ .Env.S3_REGION }}"
|
||||
folder: "tea/{{.Version}}"
|
||||
extra_files:
|
||||
- glob: ./**.xz
|
||||
- glob: ./**.sha256
|
||||
|
||||
archives:
|
||||
- format: binary
|
||||
name_template: "{{ .Binary }}"
|
||||
allow_different_binary_count: true
|
||||
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
extra_files:
|
||||
- glob: ./**.xz
|
||||
|
||||
force_token: gitea
|
||||
|
||||
signs:
|
||||
-
|
||||
signature: "${artifact}.sig"
|
||||
artifacts: checksum
|
||||
stdin: '{{ .Env.GPGSIGN_PASSPHRASE }}'
|
||||
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||
|
||||
snapshot:
|
||||
name_template: "{{ .Branch }}-devel"
|
||||
|
||||
nightly:
|
||||
name_template: "{{ .Branch }}"
|
||||
|
||||
gitea_urls:
|
||||
api: https://gitea.com/api/v1
|
||||
download: https://gitea.com
|
||||
|
||||
release:
|
||||
extra_files:
|
||||
- glob: ./**.xz
|
||||
- glob: ./**.xz.sha256
|
||||
|
||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
|
||||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
|
@ -16,7 +16,6 @@ warningCode = 1
|
|||
[rule.increment-decrement]
|
||||
[rule.var-naming]
|
||||
[rule.var-declaration]
|
||||
[rule.package-comments]
|
||||
[rule.range]
|
||||
[rule.receiver-naming]
|
||||
[rule.time-naming]
|
||||
|
|
39
CHANGELOG.md
39
CHANGELOG.md
|
@ -1,5 +1,44 @@
|
|||
# Changelog
|
||||
|
||||
## [v0.9.1](https://gitea.com/gitea/tea/releases/tag/v0.9.1) - 2023-02-15
|
||||
|
||||
* BUGFIXES
|
||||
* Print pull dont crash if it has TeamReviewRequests (#517)
|
||||
|
||||
## [v0.9.0](https://gitea.com/gitea/tea/releases/tag/v0.9.0) - 2022-09-13
|
||||
|
||||
* BREAKING
|
||||
* Rename master branch to main (#495)
|
||||
* Return RFC3339 UTC timestamps for machine-readable output (#470)
|
||||
* FEATURES
|
||||
* Allow editing multiline prompts with external text editor (#429)
|
||||
* Add `tea admin user list` (#427)
|
||||
* Add `tea whoami` command (#426)
|
||||
* Add `tea org create <name>` (#420)
|
||||
* Add `tea clone` (#411)
|
||||
* Add `tea repo fork` (#410)
|
||||
* Add `tea repo create-from-template` (#408)
|
||||
* BUGFIXES
|
||||
* Fetch all items where needed. (#475)
|
||||
* Fix running in repos without remote (#472)
|
||||
* Add TSV to machine-readable formats (#467)
|
||||
* Fix create milestone with deadline bug (#462)
|
||||
* Fix resolving of URLs in markdown (#401)
|
||||
* ENHANCEMENTS
|
||||
* Don't emit ANSI sequences when not emitting to TTY for markdown (#491)
|
||||
* Show more version info (#486)
|
||||
* Add preference `flag_defaults.remote`, refactor (#466)
|
||||
* Add `--fields` to notification & milestone listings (#422)
|
||||
* PR listing: add --fields & expose additional fields (#415)
|
||||
* Add more flags to `tea repo create` (#409)
|
||||
* Implement more issue filters (#400)
|
||||
* MISC
|
||||
* Simplify build & update installation instructions (#437)
|
||||
* Clarify command descriptions when no arguments are taken (#496)
|
||||
* Improve Documentation (#433)
|
||||
* Use golang v1.18 and drop vendor folder (#478)
|
||||
* Correct spelling of "wether" to "whether" in usage output (#453)
|
||||
|
||||
## [v0.8.0](https://gitea.com/gitea/tea/releases/tag/v0.8.0) - 2021-09-22
|
||||
|
||||
* BREAKING
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
- [Bug reports](#bug-reports)
|
||||
- [Discuss your design](#discuss-your-design)
|
||||
- [Testing redux](#testing-redux)
|
||||
- [Vendoring](#vendoring)
|
||||
- [Code review](#code-review)
|
||||
- [Styleguide](#styleguide)
|
||||
- [Sign-off your work](#sign-off-your-work)
|
||||
|
@ -57,27 +56,13 @@ high-level discussions.
|
|||
|
||||
## Testing redux
|
||||
|
||||
Before sending code out for review, run all the test by execting: `make test`
|
||||
Since TEA is an cli tool it should be obvious to test your feature localy first.
|
||||
|
||||
## Vendoring
|
||||
|
||||
We keep a cached copy of dependencies within the `vendor/` directory,
|
||||
managing updates via [dep](https://github.com/golang/dep).
|
||||
|
||||
Pull requests should only include `vendor/` updates if they are part of
|
||||
the same change, be it a bugfix or a feature addition.
|
||||
|
||||
The `vendor/` update needs to be justified as part of the PR description,
|
||||
and must be verified by the reviewers and/or merger to always reference
|
||||
an existing upstream commit.
|
||||
|
||||
You can find more information on how to get started with it on the [dep project website](https://golang.github.io/dep/docs/introduction.html).
|
||||
Before sending code out for review, run all the test by executing: `make test`
|
||||
Since TEA is an cli tool it should be obvious to test your feature locally first.
|
||||
|
||||
## Code review
|
||||
|
||||
Changes to TEA must be reviewed before they are accepted—no matter who
|
||||
makes the change, even if they are an owner or a maintainer. We use Giteas's
|
||||
makes the change, even if they are an owner or a maintainer. We use Gitea's
|
||||
pull request & review workflow to do that. Gitea ensure every PR is reviewed by at least 2 maintainers.
|
||||
|
||||
Please try to make your pull request easy to review for us. And, please read
|
||||
|
@ -118,8 +103,8 @@ Some of the key points:
|
|||
- Always make sure that the help texts are properly set, and as concise as possible.
|
||||
|
||||
### Internal Module Structure
|
||||
- `cmd`: only contains comand/flag options for `urfave/cli`
|
||||
- subcomands are in a subpackage named after its parent comand
|
||||
- `cmd`: only contains command/flag options for `urfave/cli`
|
||||
- subcommands are in a subpackage named after its parent command
|
||||
- `modules/task`: contain func for doing something with gitea
|
||||
(e.g. create token by user/passwd)
|
||||
- `modules/print`: contain all functions that print to stdout
|
||||
|
@ -175,7 +160,7 @@ maintainers](MAINTAINERS). Every PR **MUST** be reviewed by at least
|
|||
two maintainers (or owners) before it can get merged. A maintainer
|
||||
should be a contributor of Gitea (or Gogs) and contributed at least
|
||||
4 accepted PRs. A contributor should apply as a maintainer in the
|
||||
[Discord](https://discord.gg/NsatcWJ) #develop channel. The owners
|
||||
[Discord](https://discord.gg/Gitea) #develop channel. The owners
|
||||
or the team maintainers may invite the contributor. A maintainer
|
||||
should spend some time on code reviews. If a maintainer has no
|
||||
time to do that, they should apply to leave the maintainers team
|
||||
|
@ -208,7 +193,7 @@ https://help.github.com/articles/securing-your-account-with-two-factor-authentic
|
|||
|
||||
After the election, the new owners should proactively agree
|
||||
with our [CONTRIBUTING](CONTRIBUTING.md) requirements in the
|
||||
[Discord](https://discord.gg/NsatcWJ) #general channel. Below are the
|
||||
[Discord](https://discord.gg/Gitea) #general channel. Below are the
|
||||
words to speak:
|
||||
|
||||
```
|
||||
|
@ -236,8 +221,8 @@ Code that you contribute should use the standard copyright header:
|
|||
|
||||
```
|
||||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
```
|
||||
|
||||
Files in the repository contain copyright from the year they are added
|
||||
|
|
29
Dockerfile
29
Dockerfile
|
@ -1,25 +1,10 @@
|
|||
ARG GOVERSION="1.16.2"
|
||||
FROM cgr.dev/chainguard/go:latest AS build
|
||||
COPY . /build/
|
||||
WORKDIR /build
|
||||
RUN make build
|
||||
|
||||
FROM golang:${GOVERSION}-alpine AS buildenv
|
||||
|
||||
ARG CGO_ENABLED="0"
|
||||
ARG GOOS="linux"
|
||||
|
||||
COPY . $GOPATH/src/
|
||||
WORKDIR $GOPATH/src
|
||||
|
||||
RUN apk add --quiet --no-cache \
|
||||
make \
|
||||
git && \
|
||||
make build
|
||||
|
||||
FROM scratch
|
||||
ARG VERSION="0.7.0"
|
||||
LABEL org.opencontainers.image.title="tea - CLI for Gitea - git with a cup of tea"
|
||||
LABEL org.opencontainers.image.description="A command line tool to interact with Gitea servers"
|
||||
LABEL org.opencontainers.image.version="${VERSION}"
|
||||
LABEL org.opencontainers.image.authors="Tamás Gérczei <tamas@gerczei.eu>"
|
||||
LABEL org.opencontainers.image.vendor="The Gitea Authors"
|
||||
COPY --from=buildenv /go/src/tea /
|
||||
FROM cgr.dev/chainguard/static:latest
|
||||
COPY --from=build /build/tea /tea
|
||||
VOLUME [ "/app" ]
|
||||
ENV HOME="/app"
|
||||
ENTRYPOINT ["/tea"]
|
||||
|
|
1
LICENSE
1
LICENSE
|
@ -1,5 +1,4 @@
|
|||
Copyright (c) 2016 The Gitea Authors
|
||||
Copyright (c) 2015 The Gogs Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
136
Makefile
136
Makefile
|
@ -1,31 +1,12 @@
|
|||
DIST := dist
|
||||
IMPORT := code.gitea.io/tea
|
||||
export GO111MODULE=on
|
||||
|
||||
GO ?= go
|
||||
SED_INPLACE := sed -i
|
||||
SHASUM ?= shasum -a 256
|
||||
|
||||
export PATH := $($(GO) env GOPATH)/bin:$(PATH)
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
EXECUTABLE := tea.exe
|
||||
else
|
||||
EXECUTABLE := tea
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
SED_INPLACE := sed -i ''
|
||||
endif
|
||||
endif
|
||||
|
||||
GOFILES := $(shell find . -name "*.go" -type f ! -path "./vendor/*" ! -path "*/bindata.go")
|
||||
GOFILES := $(shell find . -name "*.go" -type f ! -path "*/bindata.go")
|
||||
GOFMT ?= gofmt -s
|
||||
|
||||
GOFLAGS := -i -v
|
||||
EXTRA_GOFLAGS ?=
|
||||
|
||||
MAKE_VERSION := $(shell make -v | head -n 1)
|
||||
|
||||
ifneq ($(DRONE_TAG),)
|
||||
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||
TEA_VERSION ?= $(VERSION)
|
||||
|
@ -33,35 +14,37 @@ else
|
|||
ifneq ($(DRONE_BRANCH),)
|
||||
VERSION ?= $(subst release/v,,$(DRONE_BRANCH))
|
||||
else
|
||||
VERSION ?= master
|
||||
VERSION ?= main
|
||||
endif
|
||||
TEA_VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
|
||||
endif
|
||||
|
||||
TEA_VERSION_TAG ?= $(shell sed 's/+/_/' <<< $(TEA_VERSION))
|
||||
|
||||
LDFLAGS := -X "main.Version=$(TEA_VERSION)" -X "main.Tags=$(TAGS)"
|
||||
TAGS ?=
|
||||
SDK ?= $(shell $(GO) list -f '{{.Version}}' -m code.gitea.io/sdk/gitea)
|
||||
LDFLAGS := -X "main.Version=$(TEA_VERSION)" -X "main.Tags=$(TAGS)" -X "main.SDK=$(SDK)" -s -w
|
||||
|
||||
PACKAGES ?= $(shell $(GO) list ./... | grep -v /vendor/)
|
||||
# override to allow passing additional goflags via make CLI
|
||||
override GOFLAGS := $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)'
|
||||
|
||||
PACKAGES ?= $(shell $(GO) list ./...)
|
||||
SOURCES ?= $(shell find . -name "*.go" -type f)
|
||||
|
||||
TAGS ?=
|
||||
|
||||
# OS specific vars.
|
||||
ifeq ($(OS), Windows_NT)
|
||||
EXECUTABLE := tea.exe
|
||||
VET_TOOL := gitea-vet.exe
|
||||
else
|
||||
EXECUTABLE := tea
|
||||
VET_TOOL := gitea-vet
|
||||
endif
|
||||
|
||||
# $(call strip-suffix,filename)
|
||||
strip-suffix = $(firstword $(subst ., ,$(1)))
|
||||
|
||||
.PHONY: all
|
||||
all: build
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(GO) clean -mod=vendor -i ./...
|
||||
$(GO) clean -i ./...
|
||||
rm -rf $(EXECUTABLE) $(DIST)
|
||||
|
||||
.PHONY: fmt
|
||||
|
@ -71,31 +54,22 @@ fmt:
|
|||
.PHONY: vet
|
||||
vet:
|
||||
# Default vet
|
||||
$(GO) vet -mod=vendor $(PACKAGES)
|
||||
$(GO) vet $(PACKAGES)
|
||||
# Custom vet
|
||||
$(GO) build -mod=vendor code.gitea.io/gitea-vet
|
||||
$(GO) vet -vettool=gitea-vet $(PACKAGES)
|
||||
$(GO) build code.gitea.io/gitea-vet
|
||||
$(GO) vet -vettool=$(VET_TOOL) $(PACKAGES)
|
||||
|
||||
.PHONY: lint
|
||||
lint:
|
||||
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
cd /tmp && $(GO) get -u github.com/mgechev/revive; \
|
||||
fi
|
||||
revive -config .revive.toml -exclude=./vendor/... ./... || exit 1
|
||||
lint: install-lint-tools
|
||||
$(GO) run github.com/mgechev/revive@v1.3.2 -config .revive.toml ./... || exit 1
|
||||
|
||||
.PHONY: misspell-check
|
||||
misspell-check:
|
||||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
cd /tmp && $(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
||||
fi
|
||||
misspell -error -i unknwon,destory $(GOFILES)
|
||||
misspell-check: install-lint-tools
|
||||
$(GO) run github.com/client9/misspell/cmd/misspell@latest -error -i unknwon,destory $(GOFILES)
|
||||
|
||||
.PHONY: misspell
|
||||
misspell:
|
||||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
cd /tmp && $(GO) get -u github.com/client9/misspell/cmd/misspell; \
|
||||
fi
|
||||
misspell -w -i unknwon $(GOFILES)
|
||||
misspell: install-lint-tools
|
||||
$(GO) run github.com/client9/misspell/cmd/misspell@latest -w -i unknwon $(GOFILES)
|
||||
|
||||
.PHONY: fmt-check
|
||||
fmt-check:
|
||||
|
@ -107,65 +81,53 @@ fmt-check:
|
|||
exit 1; \
|
||||
fi;
|
||||
|
||||
.PHONY: docs
|
||||
docs:
|
||||
$(GO) run . docs --out docs/CLI.md
|
||||
|
||||
.PHONY: docs-check
|
||||
docs-check:
|
||||
@DIFF=$$($(GO) run . docs | diff docs/CLI.md -); \
|
||||
if [ -n "$$DIFF" ]; then \
|
||||
echo "Please run 'make docs' and commit the result:"; \
|
||||
echo "$$DIFF"; \
|
||||
exit 1; \
|
||||
fi;
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
$(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
|
||||
$(GO) test -tags='sqlite sqlite_unlock_notify' $(PACKAGES)
|
||||
|
||||
.PHONY: unit-test-coverage
|
||||
unit-test-coverage:
|
||||
$(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
||||
$(GO) test -tags='sqlite sqlite_unlock_notify' -cover -coverprofile coverage.out $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1
|
||||
|
||||
.PHONY: vendor
|
||||
vendor:
|
||||
$(GO) mod tidy && $(GO) mod vendor
|
||||
|
||||
.PHONY: test-vendor
|
||||
test-vendor: vendor
|
||||
@diff=$$(git diff vendor/); \
|
||||
if [ -n "$$diff" ]; then \
|
||||
echo "Please run 'make vendor' and commit the result:"; \
|
||||
echo "$${diff}"; \
|
||||
exit 1; \
|
||||
fi;
|
||||
.PHONY: tidy
|
||||
tidy:
|
||||
$(GO) mod tidy
|
||||
|
||||
.PHONY: check
|
||||
check: test
|
||||
|
||||
.PHONY: install
|
||||
install: $(wildcard *.go)
|
||||
$(GO) install -mod=vendor -v -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)'
|
||||
install: $(SOURCES)
|
||||
@echo "installing to $(shell $(GO) env GOPATH)/bin/$(EXECUTABLE)"
|
||||
$(GO) install -v $(BUILDMODE) $(GOFLAGS)
|
||||
|
||||
.PHONY: build
|
||||
build: $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(SOURCES)
|
||||
$(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
||||
$(GO) build $(BUILDMODE) $(GOFLAGS) -o $@
|
||||
|
||||
.PHONY: build-image
|
||||
build-image:
|
||||
docker build --build-arg VERSION=$(TEA_VERSION) -t gitea/tea:$(TEA_VERSION_TAG) .
|
||||
|
||||
.PHONY: release
|
||||
release: release-dirs release-os release-compress release-check
|
||||
|
||||
.PHONY: release-dirs
|
||||
release-dirs:
|
||||
mkdir -p $(DIST)/binaries $(DIST)/release
|
||||
|
||||
.PHONY: release-os
|
||||
release-os:
|
||||
@hash gox > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
cd /tmp && $(GO) get -u github.com/mitchellh/gox; \
|
||||
install-lint-tools:
|
||||
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) install github.com/mgechev/revive@v1.3.2; \
|
||||
fi
|
||||
CGO_ENABLED=0 gox -verbose -cgo=false -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -osarch='!darwin/386 !darwin/arm' -os="windows linux darwin" -arch="386 amd64 arm arm64" -output="$(DIST)/release/tea-$(VERSION)-{{.OS}}-{{.Arch}}"
|
||||
|
||||
.PHONY: release-compress
|
||||
release-compress:
|
||||
@hash gxz > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
GO111MODULE=off $(GO) get -u github.com/ulikunitz/xz/cmd/gxz; \
|
||||
@hash misspell > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
$(GO) install github.com/client9/misspell/cmd/misspell@latest; \
|
||||
fi
|
||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "compressing $${file}" && gxz -k -9 $${file}; done;
|
||||
|
||||
.PHONY: release-check
|
||||
release-check:
|
||||
cd $(DIST)/release/; for file in `find . -type f -name "*"`; do echo "checksumming $${file}" && $(SHASUM) `echo $${file} | sed 's/^..//'` > $${file}.sha256; done;
|
||||
|
|
71
README.md
71
README.md
|
@ -1,23 +1,29 @@
|
|||
# <img alt='' src='https://gitea.com/repo-avatars/550-80a3a8c2ab0e2c2d69f296b7f8582485' height="40"/> *T E A*
|
||||
# <img alt='tea logo' src='https://gitea.com/repo-avatars/550-80a3a8c2ab0e2c2d69f296b7f8582485' height="40"/> *T E A*
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Release](https://raster.shields.io/badge/dynamic/json.svg?label=release&url=https://gitea.com/api/v1/repos/gitea/tea/releases&query=$[0].tag_name)](https://gitea.com/gitea/tea/releases) [![Build Status](https://drone.gitea.com/api/badges/gitea/tea/status.svg)](https://drone.gitea.com/gitea/tea) [![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea) [![Go Report Card](https://goreportcard.com/badge/code.gitea.io/tea)](https://goreportcard.com/report/code.gitea.io/tea) [![GoDoc](https://godoc.org/code.gitea.io/tea?status.svg)](https://godoc.org/code.gitea.io/tea)
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
|
||||
[![Release](https://raster.shields.io/badge/dynamic/json.svg?label=release&url=https://gitea.com/api/v1/repos/gitea/tea/releases&query=$[0].tag_name)](https://gitea.com/gitea/tea/releases)
|
||||
[![Join the chat at https://img.shields.io/discord/322538954119184384.svg](https://img.shields.io/discord/322538954119184384.svg)](https://discord.gg/Gitea)
|
||||
[![Go Report Card](https://goreportcard.com/badge/code.gitea.io/tea)](https://goreportcard.com/report/code.gitea.io/tea) [![GoDoc](https://pkg.go.dev/badge/code.gitea.io/tea?status.svg)](https://godoc.org/code.gitea.io/tea)
|
||||
|
||||
### The official CLI for Gitea
|
||||
## The official CLI for Gitea
|
||||
|
||||
![demo gif](./demo.gif)
|
||||
|
||||
```
|
||||
tea - command line tool to interact with Gitea
|
||||
version 0.7.0-preview
|
||||
version 0.8.0-preview
|
||||
|
||||
USAGE
|
||||
tea command [subcommand] [command options] [arguments...]
|
||||
|
||||
DESCRIPTION
|
||||
tea is a productivity helper for Gitea. It can be used to manage most entities on one
|
||||
or multiple Gitea instances and provides local helpers like 'tea pull checkout'.
|
||||
tea makes use of context provided by the repository in $PWD if available, but is still
|
||||
usable independently of $PWD. Configuration is persisted in $XDG_CONFIG_HOME/tea.
|
||||
tea is a productivity helper for Gitea. It can be used to manage most entities on
|
||||
one or multiple Gitea instances & provides local helpers like 'tea pr checkout'.
|
||||
|
||||
tea tries to make use of context provided by the repository in $PWD if available.
|
||||
tea works best in a upstream/fork workflow, when the local main branch tracks the
|
||||
upstream repo. tea assumes that local git state is published on the remote before
|
||||
doing operations with tea. Configuration is persisted in $XDG_CONFIG_HOME/tea.
|
||||
|
||||
COMMANDS
|
||||
help, h Shows a list of commands or help for one command
|
||||
|
@ -30,13 +36,16 @@
|
|||
times, time, t Operate on tracked times of a repository's issues & pulls
|
||||
organizations, organization, org List, create, delete organizations
|
||||
repos, repo Show repository details
|
||||
comment, c Add a comment to an issue / pr
|
||||
HELPERS:
|
||||
open, o Open something of the repository in web browser
|
||||
notifications, notification, n Show notifications
|
||||
clone, C Clone a repository locally
|
||||
SETUP:
|
||||
logins, login Log in to a Gitea server
|
||||
logout Log out from a Gitea server
|
||||
shellcompletion, autocomplete Install shell completion for tea
|
||||
whoami Show current logged in user
|
||||
|
||||
OPTIONS
|
||||
--help, -h show help (default: false)
|
||||
|
@ -58,12 +67,12 @@
|
|||
tea open milestones # open web ui for milestones
|
||||
|
||||
# send gitea desktop notifications every 5 minutes (bash + libnotify)
|
||||
while :; do tea notifications --all -o simple | xargs -i notify-send {}; sleep 300; done
|
||||
while :; do tea notifications --mine -o simple | xargs -i notify-send {}; sleep 300; done
|
||||
|
||||
ABOUT
|
||||
Written & maintained by The Gitea Authors.
|
||||
If you find a bug or want to contribute, we'll welcome you at https://gitea.com/gitea/tea.
|
||||
More info about Gitea itself on https://gitea.io.
|
||||
More info about Gitea itself on https://about.gitea.com.
|
||||
```
|
||||
|
||||
- [Compare features with other git forge CLIs](./FEATURE-COMPARISON.md)
|
||||
|
@ -74,34 +83,43 @@
|
|||
There are different ways to get `tea`:
|
||||
|
||||
1. Install via your system package manager:
|
||||
- macOS via `brew` (gitea-maintained):
|
||||
- macOS via `brew` (official):
|
||||
```sh
|
||||
brew tap gitea/tap https://gitea.com/gitea/homebrew-gitea
|
||||
brew install tea
|
||||
```
|
||||
- arch linux ([gitea-tea](https://aur.archlinux.org/packages/gitea-tea), thirdparty)
|
||||
- arch linux ([gitea-tea-git](https://aur.archlinux.org/packages/gitea-tea-git), thirdparty)
|
||||
- alpine linux ([tea](https://pkgs.alpinelinux.org/packages?name=tea&branch=edge), thirdparty)
|
||||
- Windows via `MSYS2` ([tea](https://packages.msys2.org/base/mingw-w64-tea), thirdparty)
|
||||
|
||||
2. Use the prebuilt binaries from [dl.gitea.io](https://dl.gitea.io/tea/)
|
||||
2. Use the prebuilt binaries from [dl.gitea.com](https://dl.gitea.com/tea/)
|
||||
|
||||
3. Install from source (go 1.13 or newer is required):
|
||||
```sh
|
||||
go get code.gitea.io/tea
|
||||
go install code.gitea.io/tea
|
||||
```
|
||||
3. Install from source: [see *Compilation*](#compilation)
|
||||
|
||||
4. Docker (thirdparty): [tgerczei/tea](https://hub.docker.com/r/tgerczei/tea)
|
||||
|
||||
5. asdf (thirdparty): [mvaldes14/asdf-tea](https://github.com/mvaldes14/asdf-tea)
|
||||
|
||||
## Compilation
|
||||
|
||||
Make sure you have installed a current go version.
|
||||
To compile the sources yourself run the following:
|
||||
Make sure you have a current go version installed (1.13 or newer).
|
||||
|
||||
```sh
|
||||
git clone https://gitea.com/gitea/tea.git
|
||||
cd tea
|
||||
make
|
||||
```
|
||||
- To compile the source yourself with the recommended flags & tags:
|
||||
```sh
|
||||
git clone https://gitea.com/gitea/tea.git # or: tea clone gitea.com/gitea/tea ;)
|
||||
cd tea
|
||||
make
|
||||
```
|
||||
Note that GNU Make (gmake on OpenBSD) is required.
|
||||
If you want to install the compiled program you have to execute the following command:
|
||||
```sh
|
||||
make install
|
||||
```
|
||||
This installs the binary into the "bin" folder inside of your GOPATH folder (`go env GOPATH`). It is possible that this folder isn't in your PATH Environment Variable.
|
||||
|
||||
- For a quick installation without `git` & `make`, set $version and exec:
|
||||
```sh
|
||||
go install code.gitea.io/tea@${version}
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
|
@ -109,7 +127,6 @@ Fork -> Patch -> Push -> Pull Request
|
|||
|
||||
- `make test` run testsuite
|
||||
- `make vet` run checks (check the order of imports; preventing failure on CI pipeline beforehand)
|
||||
- `make vendor` when adding new dependencies
|
||||
- ... (for other development tasks, check the `Makefile`)
|
||||
|
||||
**Please** read the [CONTRIBUTING](CONTRIBUTING.md) documentation, it will tell you about internal structures and concepts.
|
||||
|
|
7
build.go
7
build.go
|
@ -1,7 +1,8 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
//+build vendor
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
//go:build vendor
|
||||
// +build vendor
|
||||
|
||||
package main
|
||||
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"code.gitea.io/tea/cmd/admin/users"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdAdmin represents the namespace of admin commands.
|
||||
// The command itself has no functionality, but hosts subcommands.
|
||||
var CmdAdmin = cli.Command{
|
||||
Name: "admin",
|
||||
Usage: "Operations requiring admin access on the Gitea instance",
|
||||
Aliases: []string{"a"},
|
||||
Category: catMisc,
|
||||
Action: func(cmd *cli.Context) error {
|
||||
return cli.ShowSubcommandHelp(cmd)
|
||||
},
|
||||
Subcommands: []*cli.Command{
|
||||
&cmdAdminUsers,
|
||||
},
|
||||
}
|
||||
|
||||
var cmdAdminUsers = cli.Command{
|
||||
Name: "users",
|
||||
Aliases: []string{"u"},
|
||||
Usage: "Manage registered users",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
if ctx.Args().Len() == 1 {
|
||||
return runAdminUserDetail(ctx, ctx.Args().First())
|
||||
}
|
||||
return users.RunUserList(ctx)
|
||||
},
|
||||
Subcommands: []*cli.Command{
|
||||
&users.CmdUserList,
|
||||
},
|
||||
Flags: users.CmdUserList.Flags,
|
||||
}
|
||||
|
||||
func runAdminUserDetail(cmd *cli.Context, u string) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
user, _, err := client.GetUserInfo(u)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.UserDetails(user)
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package users
|
||||
|
||||
import (
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var userFieldsFlag = flags.FieldsFlag(print.UserFields, []string{
|
||||
"id", "login", "full_name", "email", "activated",
|
||||
})
|
||||
|
||||
// CmdUserList represents a sub command of users to list users
|
||||
var CmdUserList = cli.Command{
|
||||
Name: "list",
|
||||
Aliases: []string{"ls"},
|
||||
Usage: "List Users",
|
||||
Description: "List users",
|
||||
Action: RunUserList,
|
||||
Flags: append([]cli.Flag{
|
||||
userFieldsFlag,
|
||||
&flags.PaginationPageFlag,
|
||||
&flags.PaginationLimitFlag,
|
||||
}, flags.AllDefaultFlags...),
|
||||
}
|
||||
|
||||
// RunUserList list users
|
||||
func RunUserList(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
|
||||
fields, err := userFieldsFlag.GetValues(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
client := ctx.Login.Client()
|
||||
users, _, err := client.AdminListUsers(gitea.AdminListUsersOptions{
|
||||
ListOptions: ctx.GetListOptions(),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.UserList(users, ctx.Output, fields)
|
||||
|
||||
return nil
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -8,4 +7,5 @@ var (
|
|||
catSetup = "SETUP"
|
||||
catEntities = "ENTITIES"
|
||||
catHelpers = "HELPERS"
|
||||
catMisc = "MISCELLANEOUS"
|
||||
)
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/config"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/git"
|
||||
"code.gitea.io/tea/modules/interact"
|
||||
"code.gitea.io/tea/modules/task"
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdRepoClone represents a sub command of repos to create a local copy
|
||||
var CmdRepoClone = cli.Command{
|
||||
Name: "clone",
|
||||
Aliases: []string{"C"},
|
||||
Usage: "Clone a repository locally",
|
||||
Description: `Clone a repository locally, without a local git installation required.
|
||||
The repo slug can be specified in different formats:
|
||||
gitea/tea
|
||||
tea
|
||||
gitea.com/gitea/tea
|
||||
git@gitea.com:gitea/tea
|
||||
https://gitea.com/gitea/tea
|
||||
ssh://gitea.com:22/gitea/tea
|
||||
When a host is specified in the repo-slug, it will override the login specified with --login.
|
||||
`,
|
||||
Category: catHelpers,
|
||||
Action: runRepoClone,
|
||||
ArgsUsage: "<repo-slug> [target dir]",
|
||||
Flags: []cli.Flag{
|
||||
&cli.IntFlag{
|
||||
Name: "depth",
|
||||
Aliases: []string{"d"},
|
||||
Usage: "num commits to fetch, defaults to all",
|
||||
},
|
||||
&flags.LoginFlag,
|
||||
},
|
||||
}
|
||||
|
||||
func runRepoClone(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
|
||||
args := ctx.Args()
|
||||
if args.Len() < 1 {
|
||||
return cli.ShowCommandHelp(cmd, "clone")
|
||||
}
|
||||
dir := args.Get(1)
|
||||
|
||||
var (
|
||||
login *config.Login = ctx.Login
|
||||
owner string = ctx.Login.User
|
||||
repo string
|
||||
)
|
||||
|
||||
// parse first arg as repo specifier
|
||||
repoSlug := args.Get(0)
|
||||
url, err := git.ParseURL(repoSlug)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
owner, repo = utils.GetOwnerAndRepo(url.Path, login.User)
|
||||
if url.Host != "" {
|
||||
login = config.GetLoginByHost(url.Host)
|
||||
if login == nil {
|
||||
return fmt.Errorf("No login configured matching host '%s', run `tea login add` first", url.Host)
|
||||
}
|
||||
}
|
||||
|
||||
_, err = task.RepoClone(
|
||||
dir,
|
||||
login,
|
||||
owner,
|
||||
repo,
|
||||
interact.PromptPassword,
|
||||
ctx.Int("depth"),
|
||||
)
|
||||
|
||||
return err
|
||||
}
|
|
@ -1,21 +1,22 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/tea/modules/interact"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/config"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/interact"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
|
@ -48,13 +49,17 @@ func runAddComment(cmd *cli.Context) error {
|
|||
body := strings.Join(ctx.Args().Tail(), " ")
|
||||
if interact.IsStdinPiped() {
|
||||
// custom solution until https://github.com/AlecAivazis/survey/issues/328 is fixed
|
||||
if bodyStdin, err := ioutil.ReadAll(ctx.App.Reader); err != nil {
|
||||
if bodyStdin, err := io.ReadAll(ctx.App.Reader); err != nil {
|
||||
return err
|
||||
} else if len(bodyStdin) != 0 {
|
||||
body = strings.Join([]string{body, string(bodyStdin)}, "\n\n")
|
||||
}
|
||||
} else if len(body) == 0 {
|
||||
if body, err = interact.PromptMultiline("Content"); err != nil {
|
||||
if err = survey.AskOne(interact.NewMultiline(interact.Multiline{
|
||||
Message: "Comment:",
|
||||
Syntax: "md",
|
||||
UseEditor: config.GetPreferences().Editor,
|
||||
}), &body); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdDocs generates markdown for tea
|
||||
var CmdDocs = cli.Command{
|
||||
Name: "docs",
|
||||
Hidden: true,
|
||||
Description: "Generate CLI docs",
|
||||
Action: runDocs,
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "out",
|
||||
Usage: "Path to output docs to, otherwise prints to stdout",
|
||||
Aliases: []string{"o"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
func runDocs(ctx *cli.Context) error {
|
||||
md, err := ctx.App.ToMarkdown()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
outPath := ctx.String("out")
|
||||
if outPath == "" {
|
||||
fmt.Print(md)
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := os.MkdirAll(filepath.Dir(outPath), os.ModePerm); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fi, err := os.Create(outPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer fi.Close()
|
||||
if _, err := fi.WriteString(md); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package flags
|
||||
|
||||
|
@ -21,15 +20,19 @@ type CsvFlag struct {
|
|||
|
||||
// NewCsvFlag creates a CsvFlag, while setting its usage string and default values
|
||||
func NewCsvFlag(name, usage string, aliases, availableValues, defaults []string) *CsvFlag {
|
||||
var availableDesc string
|
||||
if len(availableValues) != 0 {
|
||||
availableDesc = " Available values:"
|
||||
}
|
||||
return &CsvFlag{
|
||||
AvailableFields: availableValues,
|
||||
StringFlag: cli.StringFlag{
|
||||
Name: name,
|
||||
Aliases: aliases,
|
||||
Value: strings.Join(defaults, ","),
|
||||
Usage: fmt.Sprintf(`Comma-separated list of %s. Available values:
|
||||
Usage: fmt.Sprintf(`Comma-separated list of %s.%s
|
||||
%s
|
||||
`, usage, strings.Join(availableValues, ",")),
|
||||
`, usage, availableDesc, strings.Join(availableValues, ",")),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package flags
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/task"
|
||||
|
||||
"github.com/araddon/dateparse"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
|
@ -41,14 +32,7 @@ var RemoteFlag = cli.StringFlag{
|
|||
var OutputFlag = cli.StringFlag{
|
||||
Name: "output",
|
||||
Aliases: []string{"o"},
|
||||
Usage: "Output format. (csv, simple, table, tsv, yaml)",
|
||||
}
|
||||
|
||||
// StateFlag provides flag to specify issue/pr state, defaulting to "open"
|
||||
var StateFlag = cli.StringFlag{
|
||||
Name: "state",
|
||||
Usage: "Filter by state (all|open|closed)",
|
||||
DefaultText: "open",
|
||||
Usage: "Output format. (simple, table, csv, tsv, yaml, json)",
|
||||
}
|
||||
|
||||
// PaginationPageFlag provides flag for pagination options
|
||||
|
@ -93,13 +77,6 @@ var AllDefaultFlags = append([]cli.Flag{
|
|||
&RemoteFlag,
|
||||
}, LoginOutputFlags...)
|
||||
|
||||
// IssuePRFlags defines flags that should be available on issue & pr listing flags.
|
||||
var IssuePRFlags = append([]cli.Flag{
|
||||
&StateFlag,
|
||||
&PaginationPageFlag,
|
||||
&PaginationLimitFlag,
|
||||
}, AllDefaultFlags...)
|
||||
|
||||
// NotificationFlags defines flags that should be available on notifications.
|
||||
var NotificationFlags = append([]cli.Flag{
|
||||
NotificationStateFlag,
|
||||
|
@ -121,82 +98,6 @@ var NotificationStateFlag = NewCsvFlag(
|
|||
[]string{"unread", "pinned"},
|
||||
)
|
||||
|
||||
// IssuePREditFlags defines flags for properties of issues and PRs
|
||||
var IssuePREditFlags = append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "title",
|
||||
Aliases: []string{"t"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "description",
|
||||
Aliases: []string{"d"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "assignees",
|
||||
Aliases: []string{"a"},
|
||||
Usage: "Comma-separated list of usernames to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "labels",
|
||||
Aliases: []string{"L"},
|
||||
Usage: "Comma-separated list of labels to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "deadline",
|
||||
Aliases: []string{"D"},
|
||||
Usage: "Deadline timestamp to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "milestone",
|
||||
Aliases: []string{"m"},
|
||||
Usage: "Milestone to assign",
|
||||
},
|
||||
}, LoginRepoFlags...)
|
||||
|
||||
// GetIssuePREditFlags parses all IssuePREditFlags
|
||||
func GetIssuePREditFlags(ctx *context.TeaContext) (*gitea.CreateIssueOption, error) {
|
||||
opts := gitea.CreateIssueOption{
|
||||
Title: ctx.String("title"),
|
||||
Body: ctx.String("description"),
|
||||
Assignees: strings.Split(ctx.String("assignees"), ","),
|
||||
}
|
||||
var err error
|
||||
|
||||
date := ctx.String("deadline")
|
||||
if date != "" {
|
||||
t, err := dateparse.ParseAny(date)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opts.Deadline = &t
|
||||
}
|
||||
|
||||
client := ctx.Login.Client()
|
||||
|
||||
labelNames := strings.Split(ctx.String("labels"), ",")
|
||||
if len(labelNames) != 0 {
|
||||
if client == nil {
|
||||
client = ctx.Login.Client()
|
||||
}
|
||||
if opts.Labels, err = task.ResolveLabelNames(client, ctx.Owner, ctx.Repo, labelNames); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if milestoneName := ctx.String("milestone"); len(milestoneName) != 0 {
|
||||
if client == nil {
|
||||
client = ctx.Login.Client()
|
||||
}
|
||||
ms, _, err := client.GetMilestoneByName(ctx.Owner, ctx.Repo, milestoneName)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Milestone '%s' not found", milestoneName)
|
||||
}
|
||||
opts.Milestone = ms.ID
|
||||
}
|
||||
|
||||
return &opts, nil
|
||||
}
|
||||
|
||||
// FieldsFlag generates a flag selecting printable fields.
|
||||
// To retrieve the value, use f.GetValues()
|
||||
func FieldsFlag(availableFields, defaultFields []string) *CsvFlag {
|
|
@ -0,0 +1,238 @@
|
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package flags
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/task"
|
||||
|
||||
"github.com/araddon/dateparse"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// StateFlag provides flag to specify issue/pr state, defaulting to "open"
|
||||
var StateFlag = cli.StringFlag{
|
||||
Name: "state",
|
||||
Usage: "Filter by state (all|open|closed)",
|
||||
DefaultText: "open",
|
||||
}
|
||||
|
||||
// MilestoneFilterFlag is a CSV flag used to filter issues by milestones
|
||||
var MilestoneFilterFlag = NewCsvFlag(
|
||||
"milestones",
|
||||
"milestones to match issues against",
|
||||
[]string{"m"}, nil, nil)
|
||||
|
||||
// LabelFilterFlag is a CSV flag used to filter issues by labels
|
||||
var LabelFilterFlag = NewCsvFlag(
|
||||
"labels",
|
||||
"labels to match issues against",
|
||||
[]string{"L"}, nil, nil)
|
||||
|
||||
// PRListingFlags defines flags that should be available on pr listing flags.
|
||||
var PRListingFlags = append([]cli.Flag{
|
||||
&StateFlag,
|
||||
&PaginationPageFlag,
|
||||
&PaginationLimitFlag,
|
||||
}, AllDefaultFlags...)
|
||||
|
||||
// IssueListingFlags defines flags that should be available on issue listing flags.
|
||||
var IssueListingFlags = append([]cli.Flag{
|
||||
&StateFlag,
|
||||
&cli.StringFlag{
|
||||
Name: "kind",
|
||||
Aliases: []string{"K"},
|
||||
Usage: "Whether to return `issues`, `pulls`, or `all` (you can use this to apply advanced search filters to PRs)",
|
||||
DefaultText: "issues",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "keyword",
|
||||
Aliases: []string{"k"},
|
||||
Usage: "Filter by search string",
|
||||
},
|
||||
LabelFilterFlag,
|
||||
MilestoneFilterFlag,
|
||||
&cli.StringFlag{
|
||||
Name: "author",
|
||||
Aliases: []string{"A"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "assignee",
|
||||
Aliases: []string{"a"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mentions",
|
||||
Aliases: []string{"M"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "owner",
|
||||
Aliases: []string{"org"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "from",
|
||||
Aliases: []string{"F"},
|
||||
Usage: "Filter by activity after this date",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "until",
|
||||
Aliases: []string{"u"},
|
||||
Usage: "Filter by activity before this date",
|
||||
},
|
||||
&PaginationPageFlag,
|
||||
&PaginationLimitFlag,
|
||||
}, AllDefaultFlags...)
|
||||
|
||||
// issuePRFlags defines shared flags between flags IssuePRCreateFlags and IssuePREditFlags
|
||||
var issuePRFlags = append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "title",
|
||||
Aliases: []string{"t"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "description",
|
||||
Aliases: []string{"d"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "referenced-version",
|
||||
Aliases: []string{"v"},
|
||||
Usage: "commit-hash or tag name to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "milestone",
|
||||
Aliases: []string{"m"},
|
||||
Usage: "Milestone to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "deadline",
|
||||
Aliases: []string{"D"},
|
||||
Usage: "Deadline timestamp to assign",
|
||||
},
|
||||
}, LoginRepoFlags...)
|
||||
|
||||
// IssuePRCreateFlags defines flags for creation of issues and PRs
|
||||
var IssuePRCreateFlags = append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "assignees",
|
||||
Aliases: []string{"a"},
|
||||
Usage: "Comma-separated list of usernames to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "labels",
|
||||
Aliases: []string{"L"},
|
||||
Usage: "Comma-separated list of labels to assign",
|
||||
},
|
||||
}, issuePRFlags...)
|
||||
|
||||
// GetIssuePRCreateFlags parses all IssuePREditFlags
|
||||
func GetIssuePRCreateFlags(ctx *context.TeaContext) (*gitea.CreateIssueOption, error) {
|
||||
opts := gitea.CreateIssueOption{
|
||||
Title: ctx.String("title"),
|
||||
Body: ctx.String("description"),
|
||||
Assignees: strings.Split(ctx.String("assignees"), ","),
|
||||
}
|
||||
var err error
|
||||
|
||||
date := ctx.String("deadline")
|
||||
if date != "" {
|
||||
t, err := dateparse.ParseAny(date)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opts.Deadline = &t
|
||||
}
|
||||
|
||||
client := ctx.Login.Client()
|
||||
|
||||
labelNames := strings.Split(ctx.String("labels"), ",")
|
||||
if len(labelNames) != 0 {
|
||||
if client == nil {
|
||||
client = ctx.Login.Client()
|
||||
}
|
||||
if opts.Labels, err = task.ResolveLabelNames(client, ctx.Owner, ctx.Repo, labelNames); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if milestoneName := ctx.String("milestone"); len(milestoneName) != 0 {
|
||||
if client == nil {
|
||||
client = ctx.Login.Client()
|
||||
}
|
||||
ms, _, err := client.GetMilestoneByName(ctx.Owner, ctx.Repo, milestoneName)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Milestone '%s' not found", milestoneName)
|
||||
}
|
||||
opts.Milestone = ms.ID
|
||||
}
|
||||
|
||||
return &opts, nil
|
||||
}
|
||||
|
||||
// IssuePREditFlags defines flags for editing properties of issues and PRs
|
||||
var IssuePREditFlags = append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "add-assignees",
|
||||
Aliases: []string{"a"},
|
||||
Usage: "Comma-separated list of usernames to assign",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "add-labels",
|
||||
Aliases: []string{"L"},
|
||||
Usage: "Comma-separated list of labels to assign. Takes precedence over --remove-labels",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "remove-labels",
|
||||
Usage: "Comma-separated list of labels to remove",
|
||||
},
|
||||
}, issuePRFlags...)
|
||||
|
||||
// GetIssuePREditFlags parses all IssuePREditFlags
|
||||
func GetIssuePREditFlags(ctx *context.TeaContext) (*task.EditIssueOption, error) {
|
||||
opts := task.EditIssueOption{}
|
||||
if ctx.IsSet("title") {
|
||||
val := ctx.String("title")
|
||||
opts.Title = &val
|
||||
}
|
||||
if ctx.IsSet("description") {
|
||||
val := ctx.String("description")
|
||||
opts.Body = &val
|
||||
}
|
||||
if ctx.IsSet("referenced-version") {
|
||||
val := ctx.String("referenced-version")
|
||||
opts.Ref = &val
|
||||
}
|
||||
if ctx.IsSet("milestone") {
|
||||
val := ctx.String("milestone")
|
||||
opts.Milestone = &val
|
||||
}
|
||||
if ctx.IsSet("deadline") {
|
||||
date := ctx.String("deadline")
|
||||
if date == "" {
|
||||
opts.Deadline = &time.Time{}
|
||||
} else {
|
||||
t, err := dateparse.ParseAny(date)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
opts.Deadline = &t
|
||||
}
|
||||
}
|
||||
if ctx.IsSet("add-assignees") {
|
||||
val := ctx.String("add-assignees")
|
||||
opts.AddAssignees = strings.Split(val, ",")
|
||||
}
|
||||
if ctx.IsSet("add-labels") {
|
||||
val := ctx.String("add-labels")
|
||||
opts.AddLabels = strings.Split(val, ",")
|
||||
}
|
||||
if ctx.IsSet("remove-labels") {
|
||||
val := ctx.String("remove-labels")
|
||||
opts.RemoveLabels = strings.Split(val, ",")
|
||||
}
|
||||
return &opts, nil
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -28,13 +27,14 @@ var CmdIssues = cli.Command{
|
|||
Subcommands: []*cli.Command{
|
||||
&issues.CmdIssuesList,
|
||||
&issues.CmdIssuesCreate,
|
||||
&issues.CmdIssuesEdit,
|
||||
&issues.CmdIssuesReopen,
|
||||
&issues.CmdIssuesClose,
|
||||
},
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "comments",
|
||||
Usage: "Wether to display comments (will prompt if not provided & run interactively)",
|
||||
Usage: "Whether to display comments (will prompt if not provided & run interactively)",
|
||||
},
|
||||
}, issues.CmdIssuesList.Flags...),
|
||||
}
|
||||
|
@ -54,11 +54,16 @@ func runIssueDetail(cmd *cli.Context, index string) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
issue, _, err := ctx.Login.Client().GetIssue(ctx.Owner, ctx.Repo, idx)
|
||||
client := ctx.Login.Client()
|
||||
issue, _, err := client.GetIssue(ctx.Owner, ctx.Repo, idx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
print.IssueDetails(issue)
|
||||
reactions, _, err := client.GetIssueReactions(ctx.Owner, ctx.Repo, idx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
print.IssueDetails(issue, reactions)
|
||||
|
||||
if issue.Comments > 0 {
|
||||
err = interact.ShowCommentsMaybeInteractive(ctx, idx, issue.Comments)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package issues
|
||||
|
||||
|
@ -19,9 +18,9 @@ import (
|
|||
// CmdIssuesClose represents a sub command of issues to close an issue
|
||||
var CmdIssuesClose = cli.Command{
|
||||
Name: "close",
|
||||
Usage: "Change state of an issue to 'closed'",
|
||||
Description: `Change state of an issue to 'closed'`,
|
||||
ArgsUsage: "<issue index>",
|
||||
Usage: "Change state of one ore more issues to 'closed'",
|
||||
Description: `Change state of one ore more issues to 'closed'`,
|
||||
ArgsUsage: "<issue index> [<issue index>...]",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
var s = gitea.StateClosed
|
||||
return editIssueState(ctx, gitea.EditIssueOption{State: &s})
|
||||
|
@ -37,16 +36,23 @@ func editIssueState(cmd *cli.Context, opts gitea.EditIssueOption) error {
|
|||
return fmt.Errorf(ctx.Command.ArgsUsage)
|
||||
}
|
||||
|
||||
index, err := utils.ArgToIndex(ctx.Args().First())
|
||||
indices, err := utils.ArgsToIndices(ctx.Args().Slice())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
issue, _, err := ctx.Login.Client().EditIssue(ctx.Owner, ctx.Repo, index, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
client := ctx.Login.Client()
|
||||
for _, index := range indices {
|
||||
issue, _, err := client.EditIssue(ctx.Owner, ctx.Repo, index, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.IssueDetails(issue)
|
||||
if len(indices) > 1 {
|
||||
fmt.Println(issue.HTMLURL)
|
||||
} else {
|
||||
print.IssueDetails(issue, nil)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package issues
|
||||
|
||||
|
@ -19,8 +18,9 @@ var CmdIssuesCreate = cli.Command{
|
|||
Aliases: []string{"c"},
|
||||
Usage: "Create an issue on repository",
|
||||
Description: `Create an issue on repository`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runIssuesCreate,
|
||||
Flags: flags.IssuePREditFlags,
|
||||
Flags: flags.IssuePRCreateFlags,
|
||||
}
|
||||
|
||||
func runIssuesCreate(cmd *cli.Context) error {
|
||||
|
@ -31,7 +31,7 @@ func runIssuesCreate(cmd *cli.Context) error {
|
|||
return interact.CreateIssue(ctx.Login, ctx.Owner, ctx.Repo)
|
||||
}
|
||||
|
||||
opts, err := flags.GetIssuePREditFlags(ctx)
|
||||
opts, err := flags.GetIssuePRCreateFlags(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
// Copyright 2022 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package issues
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
"code.gitea.io/tea/modules/task"
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdIssuesEdit is the subcommand of issues to edit issues
|
||||
var CmdIssuesEdit = cli.Command{
|
||||
Name: "edit",
|
||||
Aliases: []string{"e"},
|
||||
Usage: "Edit one or more issues",
|
||||
Description: `Edit one or more issues. To unset a property again,
|
||||
use an empty string (eg. --milestone "").`,
|
||||
ArgsUsage: "<idx> [<idx>...]",
|
||||
Action: runIssuesEdit,
|
||||
Flags: flags.IssuePREditFlags,
|
||||
}
|
||||
|
||||
func runIssuesEdit(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
|
||||
if !cmd.Args().Present() {
|
||||
return fmt.Errorf("must specify at least one issue index")
|
||||
}
|
||||
|
||||
opts, err := flags.GetIssuePREditFlags(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
indices, err := utils.ArgsToIndices(ctx.Args().Slice())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
client := ctx.Login.Client()
|
||||
for _, opts.Index = range indices {
|
||||
issue, err := task.EditIssue(ctx, client, *opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if ctx.Args().Len() > 1 {
|
||||
fmt.Println(issue.HTMLURL)
|
||||
} else {
|
||||
print.IssueDetails(issue, nil)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
|
@ -1,20 +1,23 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package issues
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/araddon/dateparse"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var issueFieldsFlag = flags.FieldsFlag(print.IssueFields, []string{
|
||||
"index", "title", "state", "author", "milestone", "labels",
|
||||
"index", "title", "state", "author", "milestone", "labels", "owner", "repo",
|
||||
})
|
||||
|
||||
// CmdIssuesList represents a sub command of issues to list issues
|
||||
|
@ -23,33 +26,99 @@ var CmdIssuesList = cli.Command{
|
|||
Aliases: []string{"ls"},
|
||||
Usage: "List issues of the repository",
|
||||
Description: `List issues of the repository`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunIssuesList,
|
||||
Flags: append([]cli.Flag{issueFieldsFlag}, flags.IssuePRFlags...),
|
||||
Flags: append([]cli.Flag{issueFieldsFlag}, flags.IssueListingFlags...),
|
||||
}
|
||||
|
||||
// RunIssuesList list issues
|
||||
func RunIssuesList(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
|
||||
state := gitea.StateOpen
|
||||
switch ctx.String("state") {
|
||||
case "all":
|
||||
state = gitea.StateAll
|
||||
case "open":
|
||||
case "", "open":
|
||||
state = gitea.StateOpen
|
||||
case "closed":
|
||||
state = gitea.StateClosed
|
||||
default:
|
||||
return fmt.Errorf("unknown state '%s'", ctx.String("state"))
|
||||
}
|
||||
|
||||
issues, _, err := ctx.Login.Client().ListRepoIssues(ctx.Owner, ctx.Repo, gitea.ListIssueOption{
|
||||
ListOptions: ctx.GetListOptions(),
|
||||
State: state,
|
||||
Type: gitea.IssueTypeIssue,
|
||||
})
|
||||
kind := gitea.IssueTypeIssue
|
||||
switch ctx.String("kind") {
|
||||
case "", "issues", "issue":
|
||||
kind = gitea.IssueTypeIssue
|
||||
case "pulls", "pull", "pr":
|
||||
kind = gitea.IssueTypePull
|
||||
case "all":
|
||||
kind = gitea.IssueTypeAll
|
||||
default:
|
||||
return fmt.Errorf("unknown kind '%s'", ctx.String("kind"))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
var err error
|
||||
var from, until time.Time
|
||||
if ctx.IsSet("from") {
|
||||
from, err = dateparse.ParseLocal(ctx.String("from"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if ctx.IsSet("until") {
|
||||
until, err = dateparse.ParseLocal(ctx.String("until"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
owner := ctx.Owner
|
||||
if ctx.IsSet("owner") {
|
||||
owner = ctx.String("owner")
|
||||
}
|
||||
|
||||
// ignore error, as we don't do any input validation on these flags
|
||||
labels, _ := flags.LabelFilterFlag.GetValues(cmd)
|
||||
milestones, _ := flags.MilestoneFilterFlag.GetValues(cmd)
|
||||
var issues []*gitea.Issue
|
||||
if ctx.Repo != "" {
|
||||
issues, _, err = ctx.Login.Client().ListRepoIssues(owner, ctx.Repo, gitea.ListIssueOption{
|
||||
ListOptions: ctx.GetListOptions(),
|
||||
State: state,
|
||||
Type: kind,
|
||||
KeyWord: ctx.String("keyword"),
|
||||
CreatedBy: ctx.String("author"),
|
||||
AssignedBy: ctx.String("assigned-to"),
|
||||
MentionedBy: ctx.String("mentions"),
|
||||
Labels: labels,
|
||||
Milestones: milestones,
|
||||
Since: from,
|
||||
Before: until,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
issues, _, err = ctx.Login.Client().ListIssues(gitea.ListIssueOption{
|
||||
ListOptions: ctx.GetListOptions(),
|
||||
State: state,
|
||||
Type: kind,
|
||||
KeyWord: ctx.String("keyword"),
|
||||
CreatedBy: ctx.String("author"),
|
||||
AssignedBy: ctx.String("assigned-to"),
|
||||
MentionedBy: ctx.String("mentions"),
|
||||
Labels: labels,
|
||||
Milestones: milestones,
|
||||
Since: from,
|
||||
Before: until,
|
||||
Owner: owner,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
fields, err := issueFieldsFlag.GetValues(cmd)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package issues
|
||||
|
||||
|
@ -15,9 +14,9 @@ import (
|
|||
var CmdIssuesReopen = cli.Command{
|
||||
Name: "reopen",
|
||||
Aliases: []string{"open"},
|
||||
Usage: "Change state of an issue to 'open'",
|
||||
Description: `Change state of an issue to 'open'`,
|
||||
ArgsUsage: "<issue index>",
|
||||
Usage: "Change state of one or more issues to 'open'",
|
||||
Description: `Change state of one or more issues to 'open'`,
|
||||
ArgsUsage: "<issue index> [<issue index>...]",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
var s = gitea.StateOpen
|
||||
return editIssueState(ctx, gitea.EditIssueOption{State: &s})
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -18,6 +17,7 @@ var CmdLabels = cli.Command{
|
|||
Category: catEntities,
|
||||
Usage: "Manage issue labels",
|
||||
Description: `Manage issue labels`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runLabels,
|
||||
Subcommands: []*cli.Command{
|
||||
&labels.CmdLabelsList,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package labels
|
||||
|
||||
|
@ -23,6 +22,7 @@ var CmdLabelCreate = cli.Command{
|
|||
Aliases: []string{"c"},
|
||||
Usage: "Create a label",
|
||||
Description: `Create a label`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runLabelCreate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package labels
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package labels
|
||||
|
||||
|
@ -17,6 +16,7 @@ var CmdLabelDelete = cli.Command{
|
|||
Aliases: []string{"rm"},
|
||||
Usage: "Delete a label",
|
||||
Description: `Delete a label`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runLabelDelete,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.IntFlag{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package labels
|
||||
|
||||
|
@ -20,6 +19,7 @@ var CmdLabelsList = cli.Command{
|
|||
Aliases: []string{"ls"},
|
||||
Usage: "List labels",
|
||||
Description: "List labels",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunLabelsList,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package labels
|
||||
|
||||
|
@ -17,6 +16,7 @@ var CmdLabelUpdate = cli.Command{
|
|||
Name: "update",
|
||||
Usage: "Update a label",
|
||||
Description: `Update a label`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runLabelUpdate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.IntFlag{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package login
|
||||
|
||||
|
@ -16,6 +15,7 @@ var CmdLoginAdd = cli.Command{
|
|||
Name: "add",
|
||||
Usage: "Add a Gitea login",
|
||||
Description: `Add a Gitea login, without args it will create one interactively`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "name",
|
||||
|
@ -29,6 +29,11 @@ var CmdLoginAdd = cli.Command{
|
|||
EnvVars: []string{"GITEA_SERVER_URL"},
|
||||
Usage: "Server URL",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "no-version-check",
|
||||
Aliases: []string{"nv"},
|
||||
Usage: "Do not check version of Gitea instance",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "token",
|
||||
Aliases: []string{"t"},
|
||||
|
@ -49,16 +54,36 @@ var CmdLoginAdd = cli.Command{
|
|||
EnvVars: []string{"GITEA_SERVER_PASSWORD"},
|
||||
Usage: "Password for basic auth (will create token)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "otp",
|
||||
EnvVars: []string{"GITEA_SERVER_OTP"},
|
||||
Usage: "OTP token for auth, if necessary",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "scopes",
|
||||
EnvVars: []string{"GITEA_SCOPES"},
|
||||
Usage: "Token scopes to add when creating a new token, separated by a comma",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ssh-key",
|
||||
Aliases: []string{"s"},
|
||||
Usage: "Path to a SSH key to use, overrides auto-discovery",
|
||||
Usage: "Path to a SSH key/certificate to use, overrides auto-discovery",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "insecure",
|
||||
Aliases: []string{"i"},
|
||||
Usage: "Disable TLS verification",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ssh-agent-principal",
|
||||
Aliases: []string{"c"},
|
||||
Usage: "Use SSH certificate with specified principal to login (needs a running ssh-agent with certificate loaded)",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "ssh-agent-key",
|
||||
Aliases: []string{"a"},
|
||||
Usage: "Use SSH public key or SSH fingerprint to login (needs a running ssh-agent with ssh key loaded)",
|
||||
},
|
||||
},
|
||||
Action: runLoginAdd,
|
||||
}
|
||||
|
@ -69,13 +94,24 @@ func runLoginAdd(ctx *cli.Context) error {
|
|||
return interact.CreateLogin()
|
||||
}
|
||||
|
||||
sshAgent := false
|
||||
if ctx.String("ssh-agent-key") != "" || ctx.String("ssh-agent-principal") != "" {
|
||||
sshAgent = true
|
||||
}
|
||||
|
||||
// else use args to add login
|
||||
return task.CreateLogin(
|
||||
ctx.String("name"),
|
||||
ctx.String("token"),
|
||||
ctx.String("user"),
|
||||
ctx.String("password"),
|
||||
ctx.String("otp"),
|
||||
ctx.String("scopes"),
|
||||
ctx.String("ssh-key"),
|
||||
ctx.String("url"),
|
||||
ctx.Bool("insecure"))
|
||||
ctx.String("ssh-agent-principal"),
|
||||
ctx.String("ssh-agent-key"),
|
||||
ctx.Bool("insecure"),
|
||||
sshAgent,
|
||||
!ctx.Bool("no-version-check"))
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package login
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package login
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package login
|
||||
|
||||
|
@ -18,6 +17,7 @@ var CmdLoginEdit = cli.Command{
|
|||
Aliases: []string{"e"},
|
||||
Usage: "Edit Gitea logins",
|
||||
Description: `Edit Gitea logins`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runLoginEdit,
|
||||
Flags: []cli.Flag{&flags.OutputFlag},
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package login
|
||||
|
||||
|
@ -18,6 +17,7 @@ var CmdLoginList = cli.Command{
|
|||
Aliases: []string{"ls"},
|
||||
Usage: "List Gitea logins",
|
||||
Description: `List Gitea logins`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunLoginList,
|
||||
Flags: []cli.Flag{&flags.OutputFlag},
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package milestones
|
||||
|
||||
|
@ -13,9 +12,9 @@ import (
|
|||
// CmdMilestonesClose represents a sub command of milestones to close an milestone
|
||||
var CmdMilestonesClose = cli.Command{
|
||||
Name: "close",
|
||||
Usage: "Change state of an milestone to 'closed'",
|
||||
Description: `Change state of an milestone to 'closed'`,
|
||||
ArgsUsage: "<milestone name>",
|
||||
Usage: "Change state of one or more milestones to 'closed'",
|
||||
Description: `Change state of one or more milestones to 'closed'`,
|
||||
ArgsUsage: "<milestone name> [<milestone name>...]",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
if ctx.Bool("force") {
|
||||
return deleteMilestone(ctx)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package milestones
|
||||
|
||||
|
@ -23,6 +22,7 @@ var CmdMilestonesCreate = cli.Command{
|
|||
Aliases: []string{"c"},
|
||||
Usage: "Create an milestone on repository",
|
||||
Description: `Create an milestone on repository`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runMilestonesCreate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
|
@ -55,7 +55,7 @@ func runMilestonesCreate(cmd *cli.Context) error {
|
|||
deadline := &time.Time{}
|
||||
if date != "" {
|
||||
t, err := dateparse.ParseAny(date)
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
deadline = &t
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package milestones
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package milestones
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package milestones
|
||||
|
||||
|
@ -13,14 +12,20 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var fieldsFlag = flags.FieldsFlag(print.MilestoneFields, []string{
|
||||
"title", "items", "duedate",
|
||||
})
|
||||
|
||||
// CmdMilestonesList represents a sub command of milestones to list milestones
|
||||
var CmdMilestonesList = cli.Command{
|
||||
Name: "list",
|
||||
Aliases: []string{"ls"},
|
||||
Usage: "List milestones of the repository",
|
||||
Description: `List milestones of the repository`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunMilestonesList,
|
||||
Flags: append([]cli.Flag{
|
||||
fieldsFlag,
|
||||
&cli.StringFlag{
|
||||
Name: "state",
|
||||
Usage: "Filter by milestone state (all|open|closed)",
|
||||
|
@ -36,10 +41,18 @@ func RunMilestonesList(cmd *cli.Context) error {
|
|||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
|
||||
fields, err := fieldsFlag.GetValues(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
state := gitea.StateOpen
|
||||
switch ctx.String("state") {
|
||||
case "all":
|
||||
state = gitea.StateAll
|
||||
if !cmd.IsSet("fields") { // add to default fields
|
||||
fields = append(fields, "state")
|
||||
}
|
||||
case "closed":
|
||||
state = gitea.StateClosed
|
||||
}
|
||||
|
@ -54,6 +67,6 @@ func RunMilestonesList(cmd *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
print.MilestonesList(milestones, ctx.Output, state)
|
||||
print.MilestonesList(milestones, ctx.Output, fields)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package milestones
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/urfave/cli/v2"
|
||||
|
@ -16,9 +18,9 @@ import (
|
|||
var CmdMilestonesReopen = cli.Command{
|
||||
Name: "reopen",
|
||||
Aliases: []string{"open"},
|
||||
Usage: "Change state of an milestone to 'open'",
|
||||
Description: `Change state of an milestone to 'open'`,
|
||||
ArgsUsage: "<milestone name>",
|
||||
Usage: "Change state of one or more milestones to 'open'",
|
||||
Description: `Change state of one or more milestones to 'open'`,
|
||||
ArgsUsage: "<milestone name> [<milestone name> ...]",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
return editMilestoneStatus(ctx, false)
|
||||
},
|
||||
|
@ -28,16 +30,31 @@ var CmdMilestonesReopen = cli.Command{
|
|||
func editMilestoneStatus(cmd *cli.Context, close bool) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
client := ctx.Login.Client()
|
||||
if ctx.Args().Len() == 0 {
|
||||
return fmt.Errorf(ctx.Command.ArgsUsage)
|
||||
}
|
||||
|
||||
state := gitea.StateOpen
|
||||
if close {
|
||||
state = gitea.StateClosed
|
||||
}
|
||||
_, _, err := client.EditMilestoneByName(ctx.Owner, ctx.Repo, ctx.Args().First(), gitea.EditMilestoneOption{
|
||||
State: &state,
|
||||
Title: ctx.Args().First(),
|
||||
})
|
||||
|
||||
return err
|
||||
client := ctx.Login.Client()
|
||||
for _, ms := range ctx.Args().Slice() {
|
||||
opts := gitea.EditMilestoneOption{
|
||||
State: &state,
|
||||
Title: ms,
|
||||
}
|
||||
milestone, _, err := client.EditMilestoneByName(ctx.Owner, ctx.Repo, ms, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ctx.Args().Len() > 1 {
|
||||
fmt.Printf("%s/milestone/%d\n", ctx.GetRemoteRepoHTMLURL(), milestone.ID)
|
||||
} else {
|
||||
print.MilestoneDetails(milestone)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package notifications
|
||||
|
||||
|
@ -15,7 +14,11 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var notifTypeFlag = flags.NewCsvFlag("types", "subject types to filter by", []string{"t"},
|
||||
var notifyFieldsFlag = flags.FieldsFlag(print.NotificationFields, []string{
|
||||
"id", "status", "index", "type", "state", "title",
|
||||
})
|
||||
|
||||
var notifyTypeFlag = flags.NewCsvFlag("types", "subject types to filter by", []string{"t"},
|
||||
[]string{"issue", "pull", "repository", "commit"}, nil)
|
||||
|
||||
// CmdNotificationsList represents a sub command of notifications to list notifications
|
||||
|
@ -24,8 +27,12 @@ var CmdNotificationsList = cli.Command{
|
|||
Aliases: []string{"list"},
|
||||
Usage: "List notifications",
|
||||
Description: `List notifications`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunNotificationsList,
|
||||
Flags: append([]cli.Flag{notifTypeFlag}, flags.NotificationFlags...),
|
||||
Flags: append([]cli.Flag{
|
||||
notifyFieldsFlag,
|
||||
notifyTypeFlag,
|
||||
}, flags.NotificationFlags...),
|
||||
}
|
||||
|
||||
// RunNotificationsList list notifications
|
||||
|
@ -40,7 +47,7 @@ func RunNotificationsList(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
var types []gitea.NotifySubjectType
|
||||
typesStr, err := notifTypeFlag.GetValues(ctx)
|
||||
typesStr, err := notifyTypeFlag.GetValues(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -66,7 +73,17 @@ func listNotifications(cmd *cli.Context, status []gitea.NotifyStatus, subjects [
|
|||
listOpts.Page = 1
|
||||
}
|
||||
|
||||
fields, err := notifyFieldsFlag.GetValues(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if all {
|
||||
// add repository to the default fields
|
||||
if !cmd.IsSet("fields") {
|
||||
fields = append(fields, "repository")
|
||||
}
|
||||
|
||||
news, _, err = client.ListNotifications(gitea.ListNotificationOptions{
|
||||
ListOptions: listOpts,
|
||||
Status: status,
|
||||
|
@ -84,6 +101,6 @@ func listNotifications(cmd *cli.Context, status []gitea.NotifyStatus, subjects [
|
|||
log.Fatal(err)
|
||||
}
|
||||
|
||||
print.NotificationsList(news, ctx.Output, all)
|
||||
print.NotificationsList(news, ctx.Output, fields)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package notifications
|
||||
|
||||
|
@ -28,7 +27,7 @@ var CmdNotificationsMarkRead = cli.Command{
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !flags.NotificationStateFlag.IsSet() {
|
||||
if !cmd.IsSet(flags.NotificationStateFlag.Name) {
|
||||
filter = []string{string(gitea.NotifyStatusUnread)}
|
||||
}
|
||||
return markNotificationAs(cmd, filter, gitea.NotifyStatusRead)
|
||||
|
@ -49,7 +48,7 @@ var CmdNotificationsMarkUnread = cli.Command{
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !flags.NotificationStateFlag.IsSet() {
|
||||
if !cmd.IsSet(flags.NotificationStateFlag.Name) {
|
||||
filter = []string{string(gitea.NotifyStatusRead)}
|
||||
}
|
||||
return markNotificationAs(cmd, filter, gitea.NotifyStatusUnread)
|
||||
|
@ -70,7 +69,7 @@ var CmdNotificationsMarkPinned = cli.Command{
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !flags.NotificationStateFlag.IsSet() {
|
||||
if !cmd.IsSet(flags.NotificationStateFlag.Name) {
|
||||
filter = []string{string(gitea.NotifyStatusUnread)}
|
||||
}
|
||||
return markNotificationAs(cmd, filter, gitea.NotifyStatusPinned)
|
||||
|
@ -107,10 +106,10 @@ func markNotificationAs(cmd *context.TeaContext, filterStates []string, targetSt
|
|||
opts := gitea.MarkNotificationOptions{Status: states, ToStatus: targetState}
|
||||
|
||||
if allRepos {
|
||||
_, err = client.ReadNotifications(opts)
|
||||
_, _, err = client.ReadNotifications(opts)
|
||||
} else {
|
||||
cmd.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
_, err = client.ReadRepoNotifications(cmd.Owner, cmd.Repo, opts)
|
||||
_, _, err = client.ReadRepoNotifications(cmd.Owner, cmd.Repo, opts)
|
||||
}
|
||||
|
||||
// TODO: print all affected notification subject URLs
|
||||
|
@ -121,7 +120,7 @@ func markNotificationAs(cmd *context.TeaContext, filterStates []string, targetSt
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = client.ReadNotification(id, targetState)
|
||||
_, _, err = client.ReadNotification(id, targetState)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -74,6 +73,5 @@ func runOpen(cmd *cli.Context) error {
|
|||
suffix = number
|
||||
}
|
||||
|
||||
u := path.Join(ctx.Login.URL, ctx.Owner, ctx.Repo, suffix)
|
||||
return open.Run(u)
|
||||
return open.Run(path.Join(ctx.GetRemoteRepoHTMLURL(), suffix))
|
||||
}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/organizations"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
@ -23,18 +22,26 @@ var CmdOrgs = cli.Command{
|
|||
Action: runOrganizations,
|
||||
Subcommands: []*cli.Command{
|
||||
&organizations.CmdOrganizationList,
|
||||
&organizations.CmdOrganizationCreate,
|
||||
&organizations.CmdOrganizationDelete,
|
||||
},
|
||||
Flags: organizations.CmdOrganizationList.Flags,
|
||||
}
|
||||
|
||||
func runOrganizations(ctx *cli.Context) error {
|
||||
func runOrganizations(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
if ctx.Args().Len() == 1 {
|
||||
return runOrganizationDetail(ctx.Args().First())
|
||||
return runOrganizationDetail(ctx)
|
||||
}
|
||||
return organizations.RunOrganizationList(ctx)
|
||||
return organizations.RunOrganizationList(cmd)
|
||||
}
|
||||
|
||||
func runOrganizationDetail(path string) error {
|
||||
return fmt.Errorf("Not yet implemented")
|
||||
func runOrganizationDetail(ctx *context.TeaContext) error {
|
||||
org, _, err := ctx.Login.Client().GetOrg(ctx.Args().First())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.OrganizationDetails(org)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package organizations
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdOrganizationCreate represents a sub command of organizations to delete a given user organization
|
||||
var CmdOrganizationCreate = cli.Command{
|
||||
Name: "create",
|
||||
Aliases: []string{"c"},
|
||||
Usage: "Create an organization",
|
||||
Description: "Create an organization",
|
||||
Action: RunOrganizationCreate,
|
||||
ArgsUsage: "<organization name>",
|
||||
Flags: []cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "name",
|
||||
Aliases: []string{"n"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "description",
|
||||
Aliases: []string{"d"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "website",
|
||||
Aliases: []string{"w"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "location",
|
||||
Aliases: []string{"L"},
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "visibility",
|
||||
Aliases: []string{"v"},
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "repo-admins-can-change-team-access",
|
||||
},
|
||||
&flags.LoginFlag,
|
||||
},
|
||||
}
|
||||
|
||||
// RunOrganizationCreate sets up a new organization
|
||||
func RunOrganizationCreate(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
|
||||
if ctx.Args().Len() < 1 {
|
||||
return fmt.Errorf("You have to specify the organization name you want to create")
|
||||
}
|
||||
|
||||
var visibility gitea.VisibleType
|
||||
switch ctx.String("visibility") {
|
||||
case "", "public":
|
||||
visibility = gitea.VisibleTypePublic
|
||||
case "private":
|
||||
visibility = gitea.VisibleTypePrivate
|
||||
case "limited":
|
||||
visibility = gitea.VisibleTypeLimited
|
||||
default:
|
||||
return fmt.Errorf("unknown visibility '%s'", ctx.String("visibility"))
|
||||
}
|
||||
|
||||
org, _, err := ctx.Login.Client().CreateOrg(gitea.CreateOrgOption{
|
||||
Name: ctx.Args().First(),
|
||||
// FullName: , // not really meaningful for orgs (not displayed in webui, use description instead?)
|
||||
Description: ctx.String("description"),
|
||||
Website: ctx.String("website"),
|
||||
Location: ctx.String("location"),
|
||||
RepoAdminChangeTeamAccess: ctx.Bool("repo-admins-can-change-team-access"),
|
||||
Visibility: visibility,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.OrganizationDetails(org)
|
||||
|
||||
return err
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package organizations
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package organizations
|
||||
|
||||
|
@ -19,6 +18,7 @@ var CmdOrganizationList = cli.Command{
|
|||
Aliases: []string{"ls"},
|
||||
Usage: "List Organizations",
|
||||
Description: "List users organizations",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunOrganizationList,
|
||||
Flags: append([]cli.Flag{
|
||||
&flags.PaginationPageFlag,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -30,7 +29,7 @@ var CmdPulls = cli.Command{
|
|||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
Name: "comments",
|
||||
Usage: "Wether to display comments (will prompt if not provided & run interactively)",
|
||||
Usage: "Whether to display comments (will prompt if not provided & run interactively)",
|
||||
},
|
||||
}, pulls.CmdPullsList.Flags...),
|
||||
Subcommands: []*cli.Command{
|
||||
|
@ -71,7 +70,9 @@ func runPullDetail(cmd *cli.Context, index string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
reviews, _, err := client.ListPullReviews(ctx.Owner, ctx.Repo, idx, gitea.ListPullReviewsOptions{})
|
||||
reviews, _, err := client.ListPullReviews(ctx.Owner, ctx.Repo, idx, gitea.ListPullReviewsOptions{
|
||||
ListOptions: gitea.ListOptions{Page: -1},
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Printf("error while loading reviews: %v\n", err)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
@ -35,7 +34,10 @@ var CmdPullsCheckout = cli.Command{
|
|||
|
||||
func runPullsCheckout(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{LocalRepo: true})
|
||||
ctx.Ensure(context.CtxRequirement{
|
||||
LocalRepo: true,
|
||||
RemoteRepo: true,
|
||||
})
|
||||
if ctx.Args().Len() != 1 {
|
||||
return fmt.Errorf("Must specify a PR index")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
@ -14,9 +13,9 @@ import (
|
|||
// CmdPullsClose closes a given open pull request
|
||||
var CmdPullsClose = cli.Command{
|
||||
Name: "close",
|
||||
Usage: "Change state of a pull request to 'closed'",
|
||||
Description: `Change state of a pull request to 'closed'`,
|
||||
ArgsUsage: "<pull index>",
|
||||
Usage: "Change state of one or more pull requests to 'closed'",
|
||||
Description: `Change state of one or more pull requests to 'closed'`,
|
||||
ArgsUsage: "<pull index> [<pull index>...]",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
var s = gitea.StateClosed
|
||||
return editPullState(ctx, gitea.EditPullRequestOption{State: &s})
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
@ -18,19 +17,25 @@ var CmdPullsCreate = cli.Command{
|
|||
Name: "create",
|
||||
Aliases: []string{"c"},
|
||||
Usage: "Create a pull-request",
|
||||
Description: "Create a pull-request",
|
||||
Description: "Create a pull-request in the current repo",
|
||||
Action: runPullsCreate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "head",
|
||||
Usage: "Set head branch (default is current one)",
|
||||
Usage: "Branch name of the PR source (default is current one). To specify a different head repo, use <user>:<branch>",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "base",
|
||||
Aliases: []string{"b"},
|
||||
Usage: "Set base branch (default is default branch)",
|
||||
Usage: "Branch name of the PR target (default is repos default branch)",
|
||||
},
|
||||
}, flags.IssuePREditFlags...),
|
||||
&cli.BoolFlag{
|
||||
Name: "allow-maintainer-edits",
|
||||
Aliases: []string{"edits"},
|
||||
Usage: "Enable maintainers to push to the base branch of created pull",
|
||||
Value: true,
|
||||
},
|
||||
}, flags.IssuePRCreateFlags...),
|
||||
}
|
||||
|
||||
func runPullsCreate(cmd *cli.Context) error {
|
||||
|
@ -42,7 +47,7 @@ func runPullsCreate(cmd *cli.Context) error {
|
|||
}
|
||||
|
||||
// else use args to create PR
|
||||
opts, err := flags.GetIssuePREditFlags(ctx)
|
||||
opts, err := flags.GetIssuePRCreateFlags(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -51,6 +56,7 @@ func runPullsCreate(cmd *cli.Context) error {
|
|||
ctx,
|
||||
ctx.String("base"),
|
||||
ctx.String("head"),
|
||||
ctx.Bool("allow-maintainer-edits"),
|
||||
opts,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
@ -23,16 +22,23 @@ func editPullState(cmd *cli.Context, opts gitea.EditPullRequestOption) error {
|
|||
return fmt.Errorf("Please provide a Pull Request index")
|
||||
}
|
||||
|
||||
index, err := utils.ArgToIndex(ctx.Args().First())
|
||||
indices, err := utils.ArgsToIndices(ctx.Args().Slice())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pr, _, err := ctx.Login.Client().EditPullRequest(ctx.Owner, ctx.Repo, index, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
client := ctx.Login.Client()
|
||||
for _, index := range indices {
|
||||
pr, _, err := client.EditPullRequest(ctx.Owner, ctx.Repo, index, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.PullDetails(pr, nil, nil)
|
||||
if len(indices) > 1 {
|
||||
fmt.Println(pr.HTMLURL)
|
||||
} else {
|
||||
print.PullDetails(pr, nil, nil)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
@ -13,14 +12,19 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var pullFieldsFlag = flags.FieldsFlag(print.PullFields, []string{
|
||||
"index", "title", "state", "author", "milestone", "updated", "labels",
|
||||
})
|
||||
|
||||
// CmdPullsList represents a sub command of issues to list pulls
|
||||
var CmdPullsList = cli.Command{
|
||||
Name: "list",
|
||||
Aliases: []string{"ls"},
|
||||
Usage: "List pull requests of the repository",
|
||||
Description: `List pull requests of the repository`,
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunPullsList,
|
||||
Flags: flags.IssuePRFlags,
|
||||
Flags: append([]cli.Flag{pullFieldsFlag}, flags.PRListingFlags...),
|
||||
}
|
||||
|
||||
// RunPullsList return list of pulls
|
||||
|
@ -46,6 +50,11 @@ func RunPullsList(cmd *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
print.PullsList(prs, ctx.Output)
|
||||
fields, err := pullFieldsFlag.GetValues(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
print.PullsList(prs, ctx.Output, fields)
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
@ -15,9 +14,9 @@ import (
|
|||
var CmdPullsReopen = cli.Command{
|
||||
Name: "reopen",
|
||||
Aliases: []string{"open"},
|
||||
Usage: "Change state of a pull request to 'open'",
|
||||
Description: `Change state of a pull request to 'open'`,
|
||||
ArgsUsage: "<pull index>",
|
||||
Usage: "Change state of one or more pull requests to 'open'",
|
||||
Description: `Change state of one or more pull requests to 'open'`,
|
||||
ArgsUsage: "<pull index> [<pull index>...]",
|
||||
Action: func(ctx *cli.Context) error {
|
||||
var s = gitea.StateOpen
|
||||
return editPullState(ctx, gitea.EditPullRequestOption{State: &s})
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package pulls
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -19,6 +18,7 @@ var CmdReleases = cli.Command{
|
|||
Category: catEntities,
|
||||
Usage: "Manage releases",
|
||||
Description: "Manage releases",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: releases.RunReleasesList,
|
||||
Subcommands: []*cli.Command{
|
||||
&releases.CmdReleaseList,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package releases
|
||||
|
||||
|
@ -22,16 +21,17 @@ var CmdReleaseCreate = cli.Command{
|
|||
Name: "create",
|
||||
Aliases: []string{"c"},
|
||||
Usage: "Create a release",
|
||||
Description: `Create a release`,
|
||||
Description: `Create a release for a new or existing git tag`,
|
||||
ArgsUsage: "[<tag>]",
|
||||
Action: runReleaseCreate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "tag",
|
||||
Usage: "Tag name",
|
||||
Usage: "Tag name. If the tag does not exist yet, it will be created by Gitea",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "target",
|
||||
Usage: "Target refs, branch name or commit id",
|
||||
Usage: "Target branch name or commit hash. Defaults to the default branch of the repo",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "title",
|
||||
|
@ -56,7 +56,7 @@ var CmdReleaseCreate = cli.Command{
|
|||
&cli.StringSliceFlag{
|
||||
Name: "asset",
|
||||
Aliases: []string{"a"},
|
||||
Usage: "List of files to attach",
|
||||
Usage: "Path to file attachment. Can be specified multiple times",
|
||||
},
|
||||
}, flags.AllDefaultFlags...),
|
||||
}
|
||||
|
@ -65,8 +65,16 @@ func runReleaseCreate(cmd *cli.Context) error {
|
|||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
|
||||
tag := ctx.String("tag")
|
||||
if cmd.Args().Present() {
|
||||
if len(tag) != 0 {
|
||||
return fmt.Errorf("ambiguous arguments: provide tagname via --tag or argument, but not both")
|
||||
}
|
||||
tag = cmd.Args().First()
|
||||
}
|
||||
|
||||
release, resp, err := ctx.Login.Client().CreateRelease(ctx.Owner, ctx.Repo, gitea.CreateReleaseOption{
|
||||
TagName: ctx.String("tag"),
|
||||
TagName: tag,
|
||||
Target: ctx.String("target"),
|
||||
Title: ctx.String("title"),
|
||||
Note: ctx.String("note"),
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package releases
|
||||
|
||||
|
@ -17,9 +16,9 @@ import (
|
|||
var CmdReleaseDelete = cli.Command{
|
||||
Name: "delete",
|
||||
Aliases: []string{"rm"},
|
||||
Usage: "Delete a release",
|
||||
Description: `Delete a release`,
|
||||
ArgsUsage: "<release tag>",
|
||||
Usage: "Delete one or more releases",
|
||||
Description: `Delete one or more releases`,
|
||||
ArgsUsage: "<release tag> [<release tag>...]",
|
||||
Action: runReleaseDelete,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.BoolFlag{
|
||||
|
@ -39,9 +38,8 @@ func runReleaseDelete(cmd *cli.Context) error {
|
|||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
client := ctx.Login.Client()
|
||||
|
||||
tag := ctx.Args().First()
|
||||
if len(tag) == 0 {
|
||||
fmt.Println("Release tag needed to delete")
|
||||
if !ctx.Args().Present() {
|
||||
fmt.Println("Release tag needed to edit")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -50,22 +48,20 @@ func runReleaseDelete(cmd *cli.Context) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
release, err := getReleaseByTag(ctx.Owner, ctx.Repo, tag, client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if release == nil {
|
||||
return nil
|
||||
}
|
||||
for _, tag := range ctx.Args().Slice() {
|
||||
release, err := getReleaseByTag(ctx.Owner, ctx.Repo, tag, client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = client.DeleteRelease(ctx.Owner, ctx.Repo, release.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = client.DeleteRelease(ctx.Owner, ctx.Repo, release.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ctx.Bool("delete-tag") {
|
||||
_, err = client.DeleteTag(ctx.Owner, ctx.Repo, tag)
|
||||
return err
|
||||
if ctx.Bool("delete-tag") {
|
||||
_, err = client.DeleteTag(ctx.Owner, ctx.Repo, tag)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package releases
|
||||
|
||||
|
@ -19,9 +18,9 @@ import (
|
|||
var CmdReleaseEdit = cli.Command{
|
||||
Name: "edit",
|
||||
Aliases: []string{"e"},
|
||||
Usage: "Edit a release",
|
||||
Description: `Edit a release`,
|
||||
ArgsUsage: "<release tag>",
|
||||
Usage: "Edit one or more releases",
|
||||
Description: `Edit one or more releases`,
|
||||
ArgsUsage: "<release tag> [<release tag>...]",
|
||||
Action: runReleaseEdit,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
|
@ -62,20 +61,6 @@ func runReleaseEdit(cmd *cli.Context) error {
|
|||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
client := ctx.Login.Client()
|
||||
|
||||
tag := ctx.Args().First()
|
||||
if len(tag) == 0 {
|
||||
fmt.Println("Release tag needed to edit")
|
||||
return nil
|
||||
}
|
||||
|
||||
release, err := getReleaseByTag(ctx.Owner, ctx.Repo, tag, client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if release == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
var isDraft, isPre *bool
|
||||
if ctx.IsSet("draft") {
|
||||
isDraft = gitea.OptionalBool(strings.ToLower(ctx.String("draft"))[:1] == "t")
|
||||
|
@ -84,13 +69,28 @@ func runReleaseEdit(cmd *cli.Context) error {
|
|||
isPre = gitea.OptionalBool(strings.ToLower(ctx.String("prerelease"))[:1] == "t")
|
||||
}
|
||||
|
||||
_, _, err = client.EditRelease(ctx.Owner, ctx.Repo, release.ID, gitea.EditReleaseOption{
|
||||
TagName: ctx.String("tag"),
|
||||
Target: ctx.String("target"),
|
||||
Title: ctx.String("title"),
|
||||
Note: ctx.String("note"),
|
||||
IsDraft: isDraft,
|
||||
IsPrerelease: isPre,
|
||||
})
|
||||
return err
|
||||
if !ctx.Args().Present() {
|
||||
fmt.Println("Release tag needed to edit")
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, tag := range ctx.Args().Slice() {
|
||||
release, err := getReleaseByTag(ctx.Owner, ctx.Repo, tag, client)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, _, err = client.EditRelease(ctx.Owner, ctx.Repo, release.ID, gitea.EditReleaseOption{
|
||||
TagName: ctx.String("tag"),
|
||||
Target: ctx.String("target"),
|
||||
Title: ctx.String("title"),
|
||||
Note: ctx.String("note"),
|
||||
IsDraft: isDraft,
|
||||
IsPrerelease: isPre,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package releases
|
||||
|
||||
|
@ -21,6 +20,7 @@ var CmdReleaseList = cli.Command{
|
|||
Aliases: []string{"ls"},
|
||||
Usage: "List Releases",
|
||||
Description: "List Releases",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: RunReleasesList,
|
||||
Flags: append([]cli.Flag{
|
||||
&flags.PaginationPageFlag,
|
||||
|
@ -45,19 +45,19 @@ func RunReleasesList(cmd *cli.Context) error {
|
|||
}
|
||||
|
||||
func getReleaseByTag(owner, repo, tag string, client *gitea.Client) (*gitea.Release, error) {
|
||||
rl, _, err := client.ListReleases(owner, repo, gitea.ListReleasesOptions{})
|
||||
rl, _, err := client.ListReleases(owner, repo, gitea.ListReleasesOptions{
|
||||
ListOptions: gitea.ListOptions{Page: -1},
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(rl) == 0 {
|
||||
fmt.Println("Repo does not have any release")
|
||||
return nil, nil
|
||||
return nil, fmt.Errorf("Repo does not have any release")
|
||||
}
|
||||
for _, r := range rl {
|
||||
if r.TagName == tag {
|
||||
return r, nil
|
||||
}
|
||||
}
|
||||
fmt.Println("Release tag does not exist")
|
||||
return nil, nil
|
||||
return nil, fmt.Errorf("Release tag does not exist")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
@ -27,6 +26,9 @@ var CmdRepos = cli.Command{
|
|||
&repos.CmdReposList,
|
||||
&repos.CmdReposSearch,
|
||||
&repos.CmdRepoCreate,
|
||||
&repos.CmdRepoCreateFromTemplate,
|
||||
&repos.CmdRepoFork,
|
||||
&repos.CmdRepoMigrate,
|
||||
},
|
||||
Flags: repos.CmdReposListFlags,
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
|
@ -21,6 +20,7 @@ var CmdRepoCreate = cli.Command{
|
|||
Aliases: []string{"c"},
|
||||
Usage: "Create a repository",
|
||||
Description: "Create a repository",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runRepoCreate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
|
@ -79,6 +79,14 @@ var CmdRepoCreate = cli.Command{
|
|||
Required: false,
|
||||
Usage: "use custom default branch (need --init)",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "template",
|
||||
Usage: "make repo a template repo",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "trustmodel",
|
||||
Usage: "select trust model (committer,collaborator,collaborator+committer)",
|
||||
},
|
||||
}, flags.LoginOutputFlags...),
|
||||
}
|
||||
|
||||
|
@ -86,9 +94,24 @@ func runRepoCreate(cmd *cli.Context) error {
|
|||
ctx := context.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
var (
|
||||
repo *gitea.Repository
|
||||
err error
|
||||
repo *gitea.Repository
|
||||
err error
|
||||
trustmodel gitea.TrustModel
|
||||
)
|
||||
|
||||
if ctx.IsSet("trustmodel") {
|
||||
switch ctx.String("trustmodel") {
|
||||
case "committer":
|
||||
trustmodel = gitea.TrustModelCommitter
|
||||
case "collaborator":
|
||||
trustmodel = gitea.TrustModelCollaborator
|
||||
case "collaborator+committer":
|
||||
trustmodel = gitea.TrustModelCollaboratorCommitter
|
||||
default:
|
||||
return fmt.Errorf("unknown trustmodel type '%s'", ctx.String("trustmodel"))
|
||||
}
|
||||
}
|
||||
|
||||
opts := gitea.CreateRepoOption{
|
||||
Name: ctx.String("name"),
|
||||
Description: ctx.String("description"),
|
||||
|
@ -99,6 +122,8 @@ func runRepoCreate(cmd *cli.Context) error {
|
|||
License: ctx.String("license"),
|
||||
Readme: ctx.String("readme"),
|
||||
DefaultBranch: ctx.String("branch"),
|
||||
Template: ctx.Bool("template"),
|
||||
TrustModel: trustmodel,
|
||||
}
|
||||
if len(ctx.String("owner")) != 0 {
|
||||
repo, _, err = client.CreateOrgRepo(ctx.String("owner"), opts)
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdRepoCreateFromTemplate represents a sub command of repos to generate one from a template repo
|
||||
var CmdRepoCreateFromTemplate = cli.Command{
|
||||
Name: "create-from-template",
|
||||
Aliases: []string{"ct"},
|
||||
Usage: "Create a repository based on an existing template",
|
||||
Description: "Create a repository based on an existing template",
|
||||
Action: runRepoCreateFromTemplate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "template",
|
||||
Aliases: []string{"t"},
|
||||
Required: true,
|
||||
Usage: "source template to copy from",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "name",
|
||||
Aliases: []string{"n"},
|
||||
Required: true,
|
||||
Usage: "name of new repo",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "owner",
|
||||
Aliases: []string{"O"},
|
||||
Usage: "name of repo owner",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "private",
|
||||
Usage: "make new repo private",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "description",
|
||||
Aliases: []string{"desc"},
|
||||
Usage: "add custom description to repo",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "content",
|
||||
Value: true,
|
||||
Usage: "copy git content from template",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "githooks",
|
||||
Value: true,
|
||||
Usage: "copy git hooks from template",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "avatar",
|
||||
Value: true,
|
||||
Usage: "copy repo avatar from template",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "labels",
|
||||
Value: true,
|
||||
Usage: "copy repo labels from template",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "topics",
|
||||
Value: true,
|
||||
Usage: "copy topics from template",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "webhooks",
|
||||
Usage: "copy webhooks from template",
|
||||
},
|
||||
}, flags.LoginOutputFlags...),
|
||||
}
|
||||
|
||||
func runRepoCreateFromTemplate(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
|
||||
templateOwner, templateRepo := utils.GetOwnerAndRepo(ctx.String("template"), ctx.Login.User)
|
||||
owner := ctx.Login.User
|
||||
if ctx.IsSet("owner") {
|
||||
owner = ctx.String("owner")
|
||||
}
|
||||
|
||||
opts := gitea.CreateRepoFromTemplateOption{
|
||||
Name: ctx.String("name"),
|
||||
Owner: owner,
|
||||
Description: ctx.String("description"),
|
||||
Private: ctx.Bool("private"),
|
||||
GitContent: ctx.Bool("content"),
|
||||
GitHooks: ctx.Bool("githooks"),
|
||||
Avatar: ctx.Bool("avatar"),
|
||||
Labels: ctx.Bool("labels"),
|
||||
Topics: ctx.Bool("topics"),
|
||||
Webhooks: ctx.Bool("webhooks"),
|
||||
}
|
||||
|
||||
repo, _, err := client.CreateRepoFromTemplate(templateOwner, templateRepo, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
topics, _, err := client.ListRepoTopics(repo.Owner.UserName, repo.Name, gitea.ListRepoTopicsOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
print.RepoDetails(repo, topics)
|
||||
|
||||
fmt.Printf("%s\n", repo.HTMLURL)
|
||||
return nil
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdRepoFork represents a sub command of repos to fork an existing repo
|
||||
var CmdRepoFork = cli.Command{
|
||||
Name: "fork",
|
||||
Aliases: []string{"f"},
|
||||
Usage: "Fork an existing repository",
|
||||
Description: "Create a repository from an existing repo",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runRepoFork,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "owner",
|
||||
Aliases: []string{"O"},
|
||||
Usage: "name of fork's owner, defaults to current user",
|
||||
},
|
||||
}, flags.LoginRepoFlags...),
|
||||
}
|
||||
|
||||
func runRepoFork(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
client := ctx.Login.Client()
|
||||
|
||||
opts := gitea.CreateForkOption{}
|
||||
if ctx.IsSet("owner") {
|
||||
owner := ctx.String("owner")
|
||||
opts.Organization = &owner
|
||||
}
|
||||
|
||||
repo, _, err := client.CreateFork(ctx.Owner, ctx.Repo, opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
topics, _, err := client.ListRepoTopics(repo.Owner.UserName, repo.Name, gitea.ListRepoTopicsOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
print.RepoDetails(repo, topics)
|
||||
|
||||
fmt.Printf("%s\n", repo.HTMLURL)
|
||||
return nil
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
// Copyright 2023 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdRepoMigrate represents a sub command of repos to migrate one
|
||||
var CmdRepoMigrate = cli.Command{
|
||||
Name: "migrate",
|
||||
Aliases: []string{"m"},
|
||||
Usage: "Migrate a repository",
|
||||
Description: "Migrate a repository and or mirror it.",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: runRepoMigrate,
|
||||
Flags: append([]cli.Flag{
|
||||
&cli.StringFlag{
|
||||
Name: "name",
|
||||
Usage: "Name of the repository",
|
||||
Required: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "owner",
|
||||
Usage: "Owner of the repository",
|
||||
Required: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "clone-url",
|
||||
Usage: "Clone URL of the repository",
|
||||
Required: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "service",
|
||||
Usage: string("Service to migrate from. Supported services are: " + gitea.GitServicePlain +
|
||||
", " + gitea.GitServiceGitea + ", " + gitea.GitServiceGitlab + ", " + gitea.GitServiceGogs),
|
||||
Required: true,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "mirror",
|
||||
Usage: "Mirror the repository",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "private",
|
||||
Usage: "Make the repository private",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "template",
|
||||
Usage: "Make the repository a template",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "wiki",
|
||||
Usage: "Copy the wiki",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "issues",
|
||||
Usage: "Copy the issues",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "pull-requests",
|
||||
Usage: "Copy the pull requests",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "releases",
|
||||
Usage: "Copy the releases",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "milestones",
|
||||
Usage: "Copy the milestones",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "mirror-interval",
|
||||
Usage: "Interval to mirror the repository.",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "lfs",
|
||||
Usage: "Copy the LFS objects",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "lfs-endpoint",
|
||||
Usage: "LFS endpoint to use",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "auth-user",
|
||||
Usage: "Username to use for authentication.",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "auth-password",
|
||||
Usage: "Password to use for authentication.",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "auth-token",
|
||||
Usage: "Token to use for authentication.",
|
||||
},
|
||||
}, flags.LoginOutputFlags...),
|
||||
}
|
||||
|
||||
func runRepoMigrate(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
var (
|
||||
repo *gitea.Repository
|
||||
err error
|
||||
service gitea.GitServiceType
|
||||
)
|
||||
|
||||
if ctx.IsSet("service") {
|
||||
switch ctx.String("service") {
|
||||
case "git":
|
||||
service = gitea.GitServicePlain
|
||||
case "gitea":
|
||||
service = gitea.GitServiceGitea
|
||||
case "gitlab":
|
||||
service = gitea.GitServiceGitlab
|
||||
case "gogs":
|
||||
service = gitea.GitServiceGogs
|
||||
case "github":
|
||||
service = gitea.GitServiceGithub
|
||||
default:
|
||||
return fmt.Errorf("unknown git service type '%s'", ctx.String("service"))
|
||||
}
|
||||
}
|
||||
|
||||
opts := gitea.MigrateRepoOption{
|
||||
RepoName: ctx.String("name"),
|
||||
RepoOwner: ctx.String("owner"),
|
||||
CloneAddr: ctx.String("clone-url"),
|
||||
Service: service,
|
||||
AuthUsername: ctx.String("auth-user"),
|
||||
AuthPassword: ctx.String("auth-password"),
|
||||
AuthToken: ctx.String("auth-token"),
|
||||
Mirror: ctx.Bool("mirror"),
|
||||
Private: ctx.Bool("private"),
|
||||
Description: ctx.String("description"),
|
||||
Wiki: ctx.Bool("wiki"),
|
||||
Milestones: ctx.Bool("milestones"),
|
||||
Labels: ctx.Bool("labels"),
|
||||
Issues: ctx.Bool("issues"),
|
||||
PullRequests: ctx.Bool("pull-requests"),
|
||||
Releases: ctx.Bool("releases"),
|
||||
MirrorInterval: ctx.String("mirror-interval"),
|
||||
LFS: ctx.Bool("lfs"),
|
||||
LFSEndpoint: ctx.String("lfs-endpoint"),
|
||||
}
|
||||
|
||||
repo, _, err = client.MigrateRepo(opts)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
topics, _, err := client.ListRepoTopics(repo.Owner.UserName, repo.Name, gitea.ListRepoTopicsOptions{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
print.RepoDetails(repo, topics)
|
||||
|
||||
fmt.Printf("%s\n", repo.HTMLURL)
|
||||
return nil
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package repos
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package times
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package times
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package times
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package times
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2021 The Gitea Authors. All rights reserved.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// CmdWhoami represents the command to show current logged in user
|
||||
var CmdWhoami = cli.Command{
|
||||
Name: "whoami",
|
||||
Category: catMisc,
|
||||
Description: `For debugging purposes, show the user that is currently logged in.`,
|
||||
Usage: "Show current logged in user",
|
||||
ArgsUsage: " ", // command does not accept arguments
|
||||
Action: func(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
user, _, _ := client.GetMyUserInfo()
|
||||
print.UserDetails(user)
|
||||
return nil
|
||||
},
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"packages": [
|
||||
"go@1.20",
|
||||
"gopls@latest",
|
||||
"gnumake@latest"
|
||||
],
|
||||
"shell": {
|
||||
"init_hook": [
|
||||
"echo 'Welcome to tea. Check out the Makefile for runnable targets.'"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "make"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"lockfile_version": "1",
|
||||
"packages": {
|
||||
"gnumake@latest": {
|
||||
"last_modified": "2023-08-30T00:25:28Z",
|
||||
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#gnumake",
|
||||
"source": "devbox-search",
|
||||
"version": "4.4.1"
|
||||
},
|
||||
"go@1.20": {
|
||||
"last_modified": "2023-08-30T00:25:28Z",
|
||||
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#go",
|
||||
"source": "devbox-search",
|
||||
"version": "1.20.7"
|
||||
},
|
||||
"gopls@latest": {
|
||||
"last_modified": "2023-08-30T00:25:28Z",
|
||||
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#gopls",
|
||||
"source": "devbox-search",
|
||||
"version": "0.13.2"
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
94
go.mod
94
go.mod
|
@ -1,40 +1,72 @@
|
|||
module code.gitea.io/tea
|
||||
|
||||
go 1.13
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
code.gitea.io/gitea-vet v0.2.1
|
||||
code.gitea.io/sdk/gitea v0.15.0
|
||||
gitea.com/noerw/unidiff-comments v0.0.0-20201219085024-64aec5658f2b
|
||||
github.com/AlecAivazis/survey/v2 v2.3.1
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210707164159-52430bf6b52c // indirect
|
||||
github.com/adrg/xdg v0.3.3
|
||||
github.com/alecthomas/chroma v0.9.2 // indirect
|
||||
code.gitea.io/gitea-vet v0.2.3
|
||||
code.gitea.io/sdk/gitea v0.18.0
|
||||
gitea.com/noerw/unidiff-comments v0.0.0-20220822113322-50f4daa0e35c
|
||||
github.com/AlecAivazis/survey/v2 v2.3.7
|
||||
github.com/adrg/xdg v0.4.0
|
||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
|
||||
github.com/charmbracelet/glamour v0.3.0
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
|
||||
github.com/go-git/go-git/v5 v5.4.2
|
||||
github.com/hashicorp/go-version v1.3.0 // indirect
|
||||
github.com/kevinburke/ssh_config v1.1.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.8 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/microcosm-cc/bluemonday v1.0.15 // indirect
|
||||
github.com/muesli/reflow v0.3.0 // indirect
|
||||
github.com/muesli/termenv v0.9.0
|
||||
github.com/charmbracelet/glamour v0.6.0
|
||||
github.com/enescakir/emoji v1.0.0
|
||||
github.com/go-git/go-git/v5 v5.12.0
|
||||
github.com/muesli/termenv v0.15.2
|
||||
github.com/olekukonko/tablewriter v0.0.5
|
||||
github.com/sergi/go-diff v1.2.0 // indirect
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
|
||||
github.com/stretchr/testify v1.7.0
|
||||
github.com/urfave/cli/v2 v2.3.0
|
||||
github.com/xanzy/ssh-agent v0.3.1 // indirect
|
||||
github.com/yuin/goldmark v1.4.0 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
|
||||
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
|
||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf // indirect
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
golang.org/x/tools v0.1.5 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
github.com/stretchr/testify v1.9.0
|
||||
github.com/urfave/cli/v2 v2.25.7
|
||||
golang.org/x/crypto v0.23.0
|
||||
golang.org/x/term v0.20.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
replace github.com/charmbracelet/glamour => github.com/noerw/glamour v0.3.0-patch
|
||||
require (
|
||||
dario.cat/mergo v1.0.0 // indirect
|
||||
github.com/Microsoft/go-winio v0.6.1 // indirect
|
||||
github.com/ProtonMail/go-crypto v1.0.0 // indirect
|
||||
github.com/acomagu/bufpipe v1.0.4 // indirect
|
||||
github.com/alecthomas/chroma v0.10.0 // indirect
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||
github.com/aymerick/douceur v0.2.0 // indirect
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/davidmz/go-pageant v1.0.2 // indirect
|
||||
github.com/dlclark/regexp2 v1.7.0 // indirect
|
||||
github.com/emirpasic/gods v1.18.1 // 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/go-billy/v5 v5.5.0 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/gorilla/css v1.0.0 // indirect
|
||||
github.com/hashicorp/go-version v1.6.0 // indirect
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
|
||||
github.com/kevinburke/ssh_config v1.2.0 // indirect
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
|
||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||
github.com/mattn/go-isatty v0.0.18 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.14 // indirect
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
|
||||
github.com/microcosm-cc/bluemonday v1.0.21 // indirect
|
||||
github.com/muesli/reflow v0.3.0 // indirect
|
||||
github.com/pjbgf/sha1cd v0.3.0 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/rivo/uniseg v0.4.2 // indirect
|
||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
|
||||
github.com/skeema/knownhosts v1.2.2 // indirect
|
||||
github.com/xanzy/ssh-agent v0.3.3 // indirect
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
|
||||
github.com/yuin/goldmark v1.5.2 // indirect
|
||||
github.com/yuin/goldmark-emoji v1.0.1 // indirect
|
||||
golang.org/x/mod v0.12.0 // indirect
|
||||
golang.org/x/net v0.22.0 // indirect
|
||||
golang.org/x/sys v0.20.0 // indirect
|
||||
golang.org/x/text v0.15.0 // indirect
|
||||
golang.org/x/tools v0.13.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
)
|
||||
|
|
404
go.sum
404
go.sum
|
@ -1,259 +1,337 @@
|
|||
code.gitea.io/gitea-vet v0.2.1 h1:b30by7+3SkmiftK0RjuXqFvZg2q4p68uoPGuxhzBN0s=
|
||||
code.gitea.io/gitea-vet v0.2.1/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
|
||||
code.gitea.io/sdk/gitea v0.15.0 h1:tsNhxDM/2N1Ohv1Xq5UWrht/esg0WmtRj4wsHVHriTg=
|
||||
code.gitea.io/sdk/gitea v0.15.0/go.mod h1:klY2LVI3s3NChzIk/MzMn7G1FHrfU7qd63iSMVoHRBA=
|
||||
gitea.com/noerw/unidiff-comments v0.0.0-20201219085024-64aec5658f2b h1:CLYsMGcGLohESQDMth+RgJ4cB3CCHToxnj0zBbvB3sE=
|
||||
gitea.com/noerw/unidiff-comments v0.0.0-20201219085024-64aec5658f2b/go.mod h1:Fc8iyPm4NINRWujeIk2bTfcbGc4ZYY29/oMAAGcr4qI=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.1 h1:lzkuHA60pER7L4eYL8qQJor4bUWlJe4V0gqAT19tdOA=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.1/go.mod h1:TH2kPCDU3Kqq7pLbnCWwZXDBjnhZtmsCle5EiYDJ2fg=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA=
|
||||
github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0=
|
||||
github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU=
|
||||
github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84=
|
||||
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8 h1:xzYJEypr/85nBpB11F9br+3HUrpgb+fcm5iADzXXYEw=
|
||||
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210707164159-52430bf6b52c h1:FP7mMdsXy0ybzar1sJeIcZtaJka0U/ZmLTW4wRpolYk=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20210707164159-52430bf6b52c/go.mod h1:z4/9nQmJSSwwds7ejkxaJwO37dru3geImFUdJlaLzQo=
|
||||
github.com/acomagu/bufpipe v1.0.3 h1:fxAGrHZTgQ9w5QqVItgzwj235/uYZYgbXitB+dLupOk=
|
||||
github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
|
||||
github.com/adrg/xdg v0.3.3 h1:s/tV7MdqQnzB1nKY8aqHvAMD+uCiuEDzVB5HLRY849U=
|
||||
github.com/adrg/xdg v0.3.3/go.mod h1:61xAR2VZcggl2St4O9ohF5qCKe08+JDmE4VNzPFQvOQ=
|
||||
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U=
|
||||
github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI=
|
||||
github.com/alecthomas/chroma v0.8.2/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM=
|
||||
github.com/alecthomas/chroma v0.9.2 h1:yU1sE2+TZbLIQPMk30SolL2Hn53SR/Pv750f7qZ/XMs=
|
||||
github.com/alecthomas/chroma v0.9.2/go.mod h1:eMuEnpA18XbG/WhOWtCzJHS7WqEtDAI+HxdwoW0nVSk=
|
||||
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo=
|
||||
github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
|
||||
github.com/alecthomas/kong v0.2.4/go.mod h1:kQOmtJgV+Lb4aj+I2LEn40cbtawdWJ9Y8QLq+lElKxE=
|
||||
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY=
|
||||
github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
|
||||
code.gitea.io/gitea-vet v0.2.3 h1:gdFmm6WOTM65rE8FUBTRzeQZYzXePKSSB1+r574hWwI=
|
||||
code.gitea.io/gitea-vet v0.2.3/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
|
||||
code.gitea.io/sdk/gitea v0.16.0 h1:gAfssETO1Hv9QbE+/nhWu7EjoFQYKt6kPoyDytQgw00=
|
||||
code.gitea.io/sdk/gitea v0.16.0/go.mod h1:ndkDk99BnfiUCCYEUhpNzi0lpmApXlwRFqClBlOlEBg=
|
||||
code.gitea.io/sdk/gitea v0.17.0 h1:8JPBss4+Jf7AE1YcfyiGrngTXE8dFSG3si/bypsTH34=
|
||||
code.gitea.io/sdk/gitea v0.17.0/go.mod h1:ndkDk99BnfiUCCYEUhpNzi0lpmApXlwRFqClBlOlEBg=
|
||||
code.gitea.io/sdk/gitea v0.17.1 h1:3jCPOG2ojbl8AcfaUCRYLT5MUcBMFwS0OSK2mA5Zok8=
|
||||
code.gitea.io/sdk/gitea v0.17.1/go.mod h1:aCnBqhHpoEWA180gMbaCtdX9Pl6BWBAuuP2miadoTNM=
|
||||
code.gitea.io/sdk/gitea v0.18.0 h1:+zZrwVmujIrgobt6wVBWCqITz6bn1aBjnCUHmpZrerI=
|
||||
code.gitea.io/sdk/gitea v0.18.0/go.mod h1:IG9xZJoltDNeDSW0qiF2Vqx5orMWa7OhVWrjvrd5NpI=
|
||||
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
|
||||
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
|
||||
gitea.com/noerw/unidiff-comments v0.0.0-20220822113322-50f4daa0e35c h1:8fTkq2UaVkLHZCF+iB4wTxINmVAToe2geZGayk9LMbA=
|
||||
gitea.com/noerw/unidiff-comments v0.0.0-20220822113322-50f4daa0e35c/go.mod h1:Fc8iyPm4NINRWujeIk2bTfcbGc4ZYY29/oMAAGcr4qI=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
|
||||
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
|
||||
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.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
||||
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
|
||||
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2/go.mod h1:HBCaDeC1lPdgDeDbhX8XFpy1jqjK0IBG8W5K+xYqA0w=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg=
|
||||
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
||||
github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78=
|
||||
github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0=
|
||||
github.com/acomagu/bufpipe v1.0.4 h1:e3H4WUzM3npvo5uv95QuJM3cQspFNtFBzvJ2oNjKIDQ=
|
||||
github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4=
|
||||
github.com/adrg/xdg v0.4.0 h1:RzRqFcjH4nE5C6oTAxhBtoE2IRyjBSa62SCbyPidvls=
|
||||
github.com/adrg/xdg v0.4.0/go.mod h1:N6ag73EX4wyxeaoeHctc1mas01KZgsj5tYiAIwqJE/E=
|
||||
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
|
||||
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
|
||||
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
|
||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhPwqqXc4/vE0f7GvRjuAsbW+HOIe8KnA=
|
||||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
|
||||
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/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
|
||||
github.com/aymanbagabas/go-osc52 v1.0.3/go.mod h1:zT8H+Rk4VSabYN90pWyugflM3ZhpTZNC7cASDfUCdT4=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
|
||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
|
||||
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
|
||||
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ=
|
||||
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk=
|
||||
github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
|
||||
github.com/charmbracelet/glamour v0.6.0 h1:wi8fse3Y7nfcabbbDuwolqTqMQPMnVPeZhDM273bISc=
|
||||
github.com/charmbracelet/glamour v0.6.0/go.mod h1:taqWV4swIMMbWALc0m7AfE9JkPSU8om2538k9ITBxOc=
|
||||
github.com/cloudflare/circl v1.3.3 h1:fE/Qz0QdIGqeWfnwq0RE0R7MI51s0M2E4Ga9kq5AEMs=
|
||||
github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA=
|
||||
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
|
||||
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w=
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/creack/pty v1.1.17 h1:QeVUsEDNrLBW4tMgZHvxy18sKtr6VI492kBhUfhDJNI=
|
||||
github.com/creack/pty v1.1.17/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
|
||||
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
||||
github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
|
||||
github.com/davidmz/go-pageant v1.0.2 h1:bPblRCh5jGU+Uptpz6LgMZGD5hJoOt7otgT454WvHn0=
|
||||
github.com/davidmz/go-pageant v1.0.2/go.mod h1:P2EDDnMqIwG5Rrp05dTRITj9z2zpGcD9efWSkTNKLIE=
|
||||
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
|
||||
github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
|
||||
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
|
||||
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
|
||||
github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0=
|
||||
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
|
||||
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
|
||||
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
|
||||
github.com/go-git/go-billy/v5 v5.2.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-billy/v5 v5.3.1 h1:CPiOUAzKtMRvolEKw+bG1PLRpT7D3LIs3/3ey4Aiu34=
|
||||
github.com/go-git/go-billy/v5 v5.3.1/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.2.1 h1:n9gGL1Ct/yIw+nfsfr8s4+sbhT+Ncu2SubfXjIWgci8=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6vMiRR/nnVTBtavnB0=
|
||||
github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4=
|
||||
github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
|
||||
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo=
|
||||
github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/elazarl/goproxy v0.0.0-20230808193330-2592e75ae04a h1:mATvB/9r/3gvcejNsXKSkQ6lcIaNec2nyfOdlTBR2lU=
|
||||
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
|
||||
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
|
||||
github.com/enescakir/emoji v1.0.0 h1:W+HsNql8swfCQFtioDGDHCHri8nudlK1n5p2rHCJoog=
|
||||
github.com/enescakir/emoji v1.0.0/go.mod h1:Bt1EKuLnKDTYpLALApstIkAjdDrS/8IAgTkKp+WKFD0=
|
||||
github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY=
|
||||
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-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/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU=
|
||||
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
|
||||
github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20230305113008-0c11038e723f h1:Pz0DHeFij3XFhoBRGUDPzSJ+w2UcK5/0JvF8DRI58r8=
|
||||
github.com/go-git/go-git/v5 v5.9.0 h1:cD9SFA7sHVRdJ7AYck1ZaAa/yeuBvGPxwXDL8cxrObY=
|
||||
github.com/go-git/go-git/v5 v5.9.0/go.mod h1:RKIqga24sWdMGZF+1Ekv9kylsDz6LzdTSI2s/OsZWE0=
|
||||
github.com/go-git/go-git/v5 v5.10.0 h1:F0x3xXrAWmhwtzoCokU4IMPcBdncG+HAAqi9FcOOjbQ=
|
||||
github.com/go-git/go-git/v5 v5.10.0/go.mod h1:1FOZ/pQnqw24ghP2n7cunVl0ON55BsjPYvhWHvZGhoo=
|
||||
github.com/go-git/go-git/v5 v5.11.0 h1:XIZc1p+8YzypNr34itUfSvYJcv+eYdTnTvOZ2vD3cA4=
|
||||
github.com/go-git/go-git/v5 v5.11.0/go.mod h1:6GFcX2P3NM7FPBfpePbpLd21XxsgdAt+lKqXmCUiUCY=
|
||||
github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
|
||||
github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
|
||||
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/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
|
||||
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
|
||||
github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw=
|
||||
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174 h1:WlZsjVhE8Af9IcZDGgJGQpNflI3+MJSBhsgT5PCtzBQ=
|
||||
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
|
||||
github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU=
|
||||
github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
|
||||
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
|
||||
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
|
||||
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/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
||||
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/kevinburke/ssh_config v1.1.0 h1:pH/t1WS9NzT8go394IqZeJTMHVm6Cr6ZJ6AQ+mdNo/o=
|
||||
github.com/kevinburke/ssh_config v1.1.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
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/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ=
|
||||
github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
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/matryer/is v1.2.0 h1:92UTHpy8CDwaJ08GqLDzhhuixiBUUD1p3AU6PHddz4A=
|
||||
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
|
||||
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
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-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
|
||||
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
|
||||
github.com/mattn/go-isatty v0.0.18/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.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU=
|
||||
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
|
||||
github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
|
||||
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d h1:5PJl274Y63IEHC+7izoQE9x6ikvDFZS2mDVS3drnohI=
|
||||
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
|
||||
github.com/microcosm-cc/bluemonday v1.0.6/go.mod h1:HOT/6NaBlR0f9XlxD3zolN6Z3N8Lp4pvhp+jLS5ihnI=
|
||||
github.com/microcosm-cc/bluemonday v1.0.15 h1:J4uN+qPng9rvkBZBoBb8YGR+ijuklIMpSOZZLjYpbeY=
|
||||
github.com/microcosm-cc/bluemonday v1.0.15/go.mod h1:ZLvAzeakRwrGnzQEvstVzVt3ZpqOF2+sdFr0Om+ce30=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/muesli/reflow v0.2.0/go.mod h1:qT22vjVmM9MIUeLgsVYe/Ye7eZlbv9dZjL3dVhUqLX8=
|
||||
github.com/microcosm-cc/bluemonday v1.0.21 h1:dNH3e4PSyE4vNX+KlRGHT5KrSvjeUkoNPwEORjffHJg=
|
||||
github.com/microcosm-cc/bluemonday v1.0.21/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM=
|
||||
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
|
||||
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
|
||||
github.com/muesli/termenv v0.8.1/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0=
|
||||
github.com/muesli/termenv v0.9.0 h1:wnbOaGz+LUR3jNT0zOzinPnyDaCZUQRZj9GxK8eRVl8=
|
||||
github.com/muesli/termenv v0.9.0/go.mod h1:R/LzAKf+suGs4IsO95y7+7DpFHO0KABgnZqtlyx2mBw=
|
||||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||
github.com/noerw/glamour v0.3.0-patch h1:yc3wdbUIySok6KYeX5BtWnlj+PvP1uYeCeTSwq2rtSw=
|
||||
github.com/noerw/glamour v0.3.0-patch/go.mod h1:TzF0koPZhqq0YVBNL100cPHznAAjVj7fksX2RInwjGw=
|
||||
github.com/muesli/termenv v0.13.0/go.mod h1:sP1+uffeLaEYpyOTb8pLCUctGcGLnoFjSn4YJK5e2bc=
|
||||
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
|
||||
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
|
||||
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
|
||||
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
|
||||
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
|
||||
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
|
||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
|
||||
github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=
|
||||
github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
|
||||
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/scylladb/termtables v0.0.0-20191203121021-c4c0b6d42ff4/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
|
||||
github.com/seletskiy/tplutil v0.0.0-20200921103632-f880f6245597 h1:nZY1S2jo+VtDrUfjO9XYI137O41hhRkxZNV5Fb5ixCA=
|
||||
github.com/seletskiy/tplutil v0.0.0-20200921103632-f880f6245597/go.mod h1:F8CBHSOjnzjx9EeXyWJTAzJyVxN+Y8JH2WjLMn4utiw=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||
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/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
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/skeema/knownhosts v1.2.0 h1:h9r9cf0+u7wSE+M183ZtMGgOJKiL96brpaz5ekfJCpM=
|
||||
github.com/skeema/knownhosts v1.2.0/go.mod h1:g4fPeYpque7P0xefxtGzV81ihjC8sX2IqpAoNkjxbMo=
|
||||
github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ=
|
||||
github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
|
||||
github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A=
|
||||
github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo=
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
|
||||
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.1/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.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
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/urfave/cli/v2 v2.3.0 h1:qph92Y649prgesehzOrQjdWyxFOp/QVM+6imKHad91M=
|
||||
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
|
||||
github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0=
|
||||
github.com/xanzy/ssh-agent v0.3.1 h1:AmzO1SSWxw73zxFZPRwaMN1MohDw8UyHnmuxyceTEGo=
|
||||
github.com/xanzy/ssh-agent v0.3.1/go.mod h1:QIE4lCeL7nkC25x+yA3LBIYfwCc1TFziCtG7cBAac6w=
|
||||
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/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs=
|
||||
github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ=
|
||||
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/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU=
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.3/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.0 h1:OtISOGfH6sOWa1/qXqqAiOIAO6Z5J3AEAE18WAq6BiQ=
|
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.5.2 h1:ALmeCk/px5FSm1MAcFBAsVKZjDuMVj8Tm7FFIlMJnqU=
|
||||
github.com/yuin/goldmark v1.5.2/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark-emoji v1.0.1 h1:ctuWEyzGBwiucEqxzwe0SOYDXPAucOrE9NQC18Wa1os=
|
||||
github.com/yuin/goldmark-emoji v1.0.1/go.mod h1:2w1E6FEWLcDQkoTE+7HU6QF1F6SLlNGjRIBbIZQFqkQ=
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ=
|
||||
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
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-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
|
||||
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
|
||||
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
|
||||
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
|
||||
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/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc=
|
||||
golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg=
|
||||
golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
|
||||
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
|
||||
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
|
||||
golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M=
|
||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo=
|
||||
golang.org/x/mod v0.4.2/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.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/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-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k=
|
||||
golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c=
|
||||
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/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-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||
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.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
||||
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
|
||||
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
|
||||
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
|
||||
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
|
||||
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-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
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.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/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-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/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-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/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-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k=
|
||||
golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/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-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/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.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
|
||||
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
|
||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
|
||||
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
|
||||
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
|
||||
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
||||
golang.org/x/sys v0.20.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-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
|
||||
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.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
|
||||
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.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
|
||||
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
|
||||
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8=
|
||||
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
|
||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE=
|
||||
golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY=
|
||||
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
|
||||
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
|
||||
golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q=
|
||||
golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk=
|
||||
golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
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.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.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
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.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
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.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
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-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/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-20200227125254-8fa46927fb4f/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/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
|
||||
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.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
|
45
main.go
45
main.go
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
// Tea is command line tool for Gitea.
|
||||
package main // import "code.gitea.io/tea"
|
||||
|
@ -8,6 +7,7 @@ package main // import "code.gitea.io/tea"
|
|||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/tea/cmd"
|
||||
|
@ -21,6 +21,9 @@ var Version = "development"
|
|||
// Tags holds the build tags used
|
||||
var Tags = ""
|
||||
|
||||
// SDK holds the sdk version from go.mod
|
||||
var SDK = ""
|
||||
|
||||
func main() {
|
||||
// make parsing tea --version easier, by printing /just/ the version string
|
||||
cli.VersionPrinter = func(c *cli.Context) { fmt.Fprintln(c.App.Writer, c.App.Version) }
|
||||
|
@ -30,11 +33,12 @@ func main() {
|
|||
app.Usage = "command line tool to interact with Gitea"
|
||||
app.Description = appDescription
|
||||
app.CustomAppHelpTemplate = helpTemplate
|
||||
app.Version = Version + formatBuiltWith(Tags)
|
||||
app.Version = formatVersion()
|
||||
app.Commands = []*cli.Command{
|
||||
&cmd.CmdLogin,
|
||||
&cmd.CmdLogout,
|
||||
&cmd.CmdAutocomplete,
|
||||
&cmd.CmdWhoami,
|
||||
|
||||
&cmd.CmdIssues,
|
||||
&cmd.CmdPulls,
|
||||
|
@ -48,6 +52,10 @@ func main() {
|
|||
|
||||
&cmd.CmdOpen,
|
||||
&cmd.CmdNotifications,
|
||||
&cmd.CmdRepoClone,
|
||||
|
||||
&cmd.CmdAdmin,
|
||||
&cmd.CmdDocs,
|
||||
}
|
||||
app.EnableBashCompletion = true
|
||||
err := app.Run(os.Args)
|
||||
|
@ -59,18 +67,29 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
func formatBuiltWith(Tags string) string {
|
||||
if len(Tags) == 0 {
|
||||
return ""
|
||||
func formatVersion() string {
|
||||
version := fmt.Sprintf("Version: %s\tgolang: %s",
|
||||
bold(Version),
|
||||
strings.ReplaceAll(runtime.Version(), "go", ""))
|
||||
|
||||
if len(Tags) != 0 {
|
||||
version += fmt.Sprintf("\tbuilt with: %s", strings.Replace(Tags, " ", ", ", -1))
|
||||
}
|
||||
|
||||
return " built with: " + strings.Replace(Tags, " ", ", ", -1)
|
||||
if len(SDK) != 0 {
|
||||
version += fmt.Sprintf("\tgo-sdk: %s", SDK)
|
||||
}
|
||||
|
||||
return version
|
||||
}
|
||||
|
||||
var appDescription = `tea is a productivity helper for Gitea. It can be used to manage most entities on one
|
||||
or multiple Gitea instances and provides local helpers like 'tea pull checkout'.
|
||||
tea makes use of context provided by the repository in $PWD if available, but is still
|
||||
usable independently of $PWD. Configuration is persisted in $XDG_CONFIG_HOME/tea.
|
||||
var appDescription = `tea is a productivity helper for Gitea. It can be used to manage most entities on
|
||||
one or multiple Gitea instances & provides local helpers like 'tea pr checkout'.
|
||||
|
||||
tea tries to make use of context provided by the repository in $PWD if available.
|
||||
tea works best in a upstream/fork workflow, when the local main branch tracks the
|
||||
upstream repo. tea assumes that local git state is published on the remote before
|
||||
doing operations with tea. Configuration is persisted in $XDG_CONFIG_HOME/tea.
|
||||
`
|
||||
|
||||
var helpTemplate = bold(`
|
||||
|
@ -108,12 +127,12 @@ var helpTemplate = bold(`
|
|||
tea open milestones # open web ui for milestones
|
||||
|
||||
# send gitea desktop notifications every 5 minutes (bash + libnotify)
|
||||
while :; do tea notifications --all -o simple | xargs -i notify-send {}; sleep 300; done
|
||||
while :; do tea notifications --mine -o simple | xargs -i notify-send {}; sleep 300; done
|
||||
|
||||
ABOUT
|
||||
Written & maintained by The Gitea Authors.
|
||||
If you find a bug or want to contribute, we'll welcome you at https://gitea.com/gitea/tea.
|
||||
More info about Gitea itself on https://gitea.io.
|
||||
More info about Gitea itself on https://about.gitea.com.
|
||||
`
|
||||
|
||||
func bold(t string) string {
|
||||
|
|
|
@ -1,25 +1,41 @@
|
|||
// Copyright 2020 The Gitea Authors. All rights reserved.
|
||||
// Use of this source code is governed by a MIT-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
|
||||
"github.com/adrg/xdg"
|
||||
"gopkg.in/yaml.v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// FlagDefaults defines all flags that can be overridden with a default value
|
||||
// via the config file
|
||||
type FlagDefaults struct {
|
||||
// Prefer a specific git remote to use for selecting a repository on gitea,
|
||||
// instead of relying on the remote associated with main/master/trunk branch.
|
||||
// The --remote flag still has precedence over this value.
|
||||
Remote string `yaml:"remote"`
|
||||
}
|
||||
|
||||
// Preferences that are stored in and read from the config file
|
||||
type Preferences struct {
|
||||
// Prefer using an external text editor over inline multiline prompts
|
||||
Editor bool `yaml:"editor"`
|
||||
FlagDefaults FlagDefaults `yaml:"flag_defaults"`
|
||||
}
|
||||
|
||||
// LocalConfig represents local configurations
|
||||
type LocalConfig struct {
|
||||
Logins []Login `yaml:"logins"`
|
||||
Logins []Login `yaml:"logins"`
|
||||
Prefs Preferences `yaml:"preferences"`
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -55,13 +71,19 @@ func GetConfigPath() string {
|
|||
return configFilePath
|
||||
}
|
||||
|
||||
// GetPreferences returns preferences based on the config file
|
||||
func GetPreferences() Preferences {
|
||||
_ = loadConfig()
|
||||
return config.Prefs
|
||||
}
|
||||
|
||||
// loadConfig load config from file
|
||||
func loadConfig() (err error) {
|
||||
loadConfigOnce.Do(func() {
|
||||
ymlPath := GetConfigPath()
|
||||
exist, _ := utils.FileExist(ymlPath)
|
||||
if exist {
|
||||
bs, err := ioutil.ReadFile(ymlPath)
|
||||
bs, err := os.ReadFile(ymlPath)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("Failed to read config file: %s", ymlPath)
|
||||
}
|
||||
|
@ -82,5 +104,5 @@ func saveConfig() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return ioutil.WriteFile(ymlPath, bs, 0660)
|
||||
return os.WriteFile(ymlPath, bs, 0o660)
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue