repos

command module
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

README

Repos


Go build and release by GoReleaser


Table of Contents



用于克隆指定用户的指定仓库

Install

一键安装

curl -fsSL https://raw.githubusercontent.com/YHYJ/repos/main/install.sh | sudo bash -s

Usage

  • config子命令

    该子命令用于操作配置文件,有以下参数:

    • 'create':创建默认内容的配置文件,可以使用全局参数'--config'指定配置文件路径
    • 'force':当指定的配置文件已存在时,使用该参数强制覆盖原文件
    • 'print':打印配置文件内容
  • clone子命令

    使用该子命令进行克隆,有以下参数:

    • '--source':指定使用的仓库源,目前支持 github.com 和 git.yj1516.top
  • version子命令

    查看程序版本信息

  • help子命令

    查看程序帮助信息

Compile

当前平台

go build -gcflags="-trimpath" -ldflags="-s -w -X github.com/yhyj/repos/general.GitCommitHash=`git rev-parse HEAD` -X github.com/yhyj/repos/general.BuildTime=`date +%s` -X github.com/yhyj/repos/general.BuildBy=$USER" -o build/repos main.go

交叉编译

使用命令go tool dist list查看支持的平台

Linux
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -gcflags="-trimpath" -ldflags="-s -w -X github.com/yhyj/repos/general.GitCommitHash=`git rev-parse HEAD` -X github.com/yhyj/repos/general.BuildTime=`date +%s` -X github.com/yhyj/repos/general.BuildBy=$USER" -o build/repos main.go

使用uname -m确定硬件架构

  • 结果是 x86_64 则 GOARCH=amd64
  • 结果是 aarch64 则 GOARCH=arm64
macOS
CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -gcflags="-trimpath" -ldflags="-s -w -X github.com/yhyj/repos/general.GitCommitHash=`git rev-parse HEAD` -X github.com/yhyj/repos/general.BuildTime=`date +%s` -X github.com/yhyj/repos/general.BuildBy=$USER" -o build/repos main.go

使用uname -m确定硬件架构

  • 结果是 x86_64 则 GOARCH=amd64
  • 结果是 aarch64 则 GOARCH=arm64
Windows
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -gcflags="-trimpath" -ldflags="-s -w -H windowsgui -X github.com/yhyj/repos/general.GitCommitHash=`git rev-parse HEAD` -X github.com/yhyj/repos/general.BuildTime=`date +%s` -X github.com/yhyj/repos/general.BuildBy=$USER" -o build/repos.exe main.go

使用echo %PROCESSOR_ARCHITECTURE%确定硬件架构

  • 结果是 x86_64 则 GOARCH=amd64
  • 结果是 aarch64 则 GOARCH=arm64

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL