6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-10 02:04:20 +00:00

Update goreleaser and readme to match the new single binary format

This commit is contained in:
Grzegorz Dlugoszewski
2025-08-23 22:38:09 +02:00
parent f0365087ce
commit 71f62b2b97
4 changed files with 103 additions and 35 deletions

View File

@@ -6,36 +6,39 @@ before:
builds: builds:
- id: git-get - id: git-get
main: ./cmd/get/main.go main: ./cmd/
binary: git-get binary: git-get
ldflags: ldflags:
- -s -w - -s -w
- -X git-get/pkg/cfg.version={{.Version}} - -X git-get/pkg/cfg.version={{.Version}}
- -X git-get/pkg/cfg.commit={{.Commit}} - -X git-get/pkg/cfg.commit={{.Commit}}
- -X git-get/pkg/cfg.date={{.Date}}
goos: goos:
- linux - linux
- darwin
- windows - windows
- id: git-list goarch:
main: ./cmd/list/main.go - amd64
binary: git-list - arm64
- arm
goarm:
- 7
- id: git-get-macos
main: ./cmd/
binary: git-get
ldflags: ldflags:
- -s -w - -s -w
- -X git-get/pkg/cfg.version={{.Version}} - -X git-get/pkg/cfg.version={{.Version}}
- -X git-get/pkg/cfg.commit={{.Commit}} - -X git-get/pkg/cfg.commit={{.Commit}}
- -X git-get/pkg/cfg.date={{.Date}}
goos: goos:
- linux
- darwin - darwin
- windows goarch:
- amd64
- arm64
archives: archives:
- id: archive - id: archive
ids: ids:
- git-get - git-get
- git-list name_template: "git-get_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}{{- if .Amd64 }}v{{ .Amd64 }}{{ end }}"
name_template: "git-get_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
formats: formats:
- tar.gz - tar.gz
- zip - zip
@@ -43,6 +46,14 @@ archives:
- goos: windows - goos: windows
formats: [zip] formats: [zip]
# Don't include any additional files into the archives (such as README, CHANGELOG etc). # Don't include any additional files into the archives (such as README, CHANGELOG etc).
files:
- none*
- id: macos-archive
ids:
- git-get-macos
name_template: "git-get_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{- if .Arm }}v{{ .Arm }}{{ end }}{{- if .Amd64 }}v{{ .Amd64 }}{{ end }}"
formats:
- tar.gz
files: files:
- none* - none*
@@ -64,8 +75,10 @@ release:
owner: grdl owner: grdl
name: git-get name: git-get
brews: homebrew_casks:
- name: git-get - name: git-get
ids:
- macos-archive
repository: repository:
owner: grdl owner: grdl
name: homebrew-tap name: homebrew-tap
@@ -73,13 +86,14 @@ brews:
commit_author: commit_author:
name: Grzegorz Dlugoszewski name: Grzegorz Dlugoszewski
email: git-get@grdl.dev email: git-get@grdl.dev
directory: Formula
homepage: https://github.com/grdl/git-get/ homepage: https://github.com/grdl/git-get/
description: Better way to clone, organize and manage multiple git repositories description: Better way to clone, organize and manage multiple git repositories
test: | url:
system "git-get --version" verified: github.com/grdl/git-get
install: | hooks:
bin.install "git-get", "git-list" post:
install: |
system_command "/bin/ln", args: ["-sf", "#{staged_path}/git-get", "#{HOMEBREW_PREFIX}/bin/git-list"]
nfpms: nfpms:
- id: packages - id: packages
@@ -94,6 +108,9 @@ nfpms:
formats: formats:
- deb - deb
- rpm - rpm
scripts:
postinstall: "scripts/postinstall.sh"
preremove: "scripts/preremove.sh"
scoops: scoops:
- name: git-get - name: git-get
@@ -110,3 +127,6 @@ scoops:
homepage: "https://github.com/grdl/git-get" homepage: "https://github.com/grdl/git-get"
description: "Better way to clone, organize and manage multiple git repositories" description: "Better way to clone, organize and manage multiple git repositories"
license: MIT license: MIT
post_install: [
"New-Item -ItemType HardLink -Path \"$dir\\git-list.exe\" -Target \"$dir\\git-get.exe\" -Force | Out-Null"
]

View File

@@ -37,10 +37,12 @@ A tool to clone, organize, and manage multiple Git repositories with an automati
**git-get** solves the problem of manually organizing multiple Git repositories. Instead of scattered clones in random directories, it creates a clean, predictable directory structure based on repository URLs, similar to Go's `go get` command. **git-get** solves the problem of manually organizing multiple Git repositories. Instead of scattered clones in random directories, it creates a clean, predictable directory structure based on repository URLs, similar to Go's `go get` command.
It provides two commands: It provides two commands through a single binary:
- **`git get`** - Clones repositories into an organized directory tree - **`git get`** - Clones repositories into an organized directory tree
- **`git list`** - Shows the status of all your repositories at a glance - **`git list`** - Shows the status of all your repositories at a glance
*Note: Both commands are provided by a single `git-get` binary that automatically detects how it was invoked (either directly or via symlink).*
![Example](./docs/example.svg) ![Example](./docs/example.svg)
## Features ## Features
@@ -56,51 +58,91 @@ It provides two commands:
## Prerequisites ## Prerequisites
- Git 2.0+ installed and configured - Git 2.0+ installed and configured
- Go 1.19+ (only if building from source) - Go 1.24+ (only if building from source)
## Installation ## Installation
### macOS ### macOS
**Option 1: Homebrew (Recommended)**
```bash ```bash
brew install grdl/tap/git-get brew install grdl/tap/git-get
``` ```
*This automatically installs both `git-get` and `git-list` commands.*
**Option 2: Manual Installation**
1. Download the latest macOS `.tar.gz` file from [releases](https://github.com/grdl/git-get/releases/latest)
2. Extract and install:
```bash
tar -xzf git-get_*_darwin_*.tar.gz
sudo mv git-get /usr/local/bin/
sudo ln -sf /usr/local/bin/git-get /usr/local/bin/git-list
```
### Linux ### Linux
**Option 1: Package managers** **Option 1: Package Managers (Recommended)**
```bash ```bash
# Download .deb or .rpm from releases # Ubuntu/Debian - Download and install .deb package
wget https://github.com/grdl/git-get/releases/latest/download/git-get_linux_amd64.deb wget https://github.com/grdl/git-get/releases/latest/download/git-get_*_linux_amd64.deb
sudo dpkg -i git-get_linux_amd64.deb sudo dpkg -i git-get_*_linux_amd64.deb
# CentOS/RHEL/Fedora - Download and install .rpm package
wget https://github.com/grdl/git-get/releases/latest/download/git-get_*_linux_amd64.rpm
sudo rpm -i git-get_*_linux_amd64.rpm
```
*Package installation automatically creates the `git-list` symlink.*
**Option 2: Manual Installation**
```bash
# Download and extract
wget https://github.com/grdl/git-get/releases/latest/download/git-get_*_linux_amd64.tar.gz
tar -xzf git-get_*_linux_amd64.tar.gz
# Install binary and create symlink
sudo mv git-get /usr/local/bin/
sudo ln -sf /usr/local/bin/git-get /usr/local/bin/git-list
``` ```
**Option 2: Homebrew on Linux** **Option 3: Homebrew on Linux**
```bash ```bash
brew install grdl/tap/git-get brew install grdl/tap/git-get
``` ```
### Windows ### Windows
**Option 1: Download binary** **Option 1: Scoop (Recommended)**
1. Download the latest `.zip` file from [releases](https://github.com/grdl/git-get/releases/latest)
2. Extract the binaries to a directory in your PATH
**Option 2: Using Scoop**
```powershell ```powershell
scoop bucket add git-get https://github.com/grdl/git-get scoop bucket add grdl https://github.com/grdl/git-get
scoop install git-get scoop install git-get
``` ```
*This automatically creates both `git-get.exe` and `git-list.exe` commands.*
**Option 2: Manual Installation**
1. Download the latest Windows `.zip` file from [releases](https://github.com/grdl/git-get/releases/latest)
2. Extract `git-get.exe` to a directory in your PATH
3. Create a copy or hard link for `git-list`:
```powershell
# In the same directory as git-get.exe
Copy-Item git-get.exe git-list.exe
# OR create a hard link (requires admin privileges)
New-Item -ItemType HardLink -Path "git-list.exe" -Target "git-get.exe"
```
### Building from Source ### Building from Source
```bash ```bash
git clone https://github.com/grdl/git-get.git git clone https://github.com/grdl/git-get.git
cd git-get cd git-get
go build -o bin/ ./cmd/... go build -o git-get ./cmd/
# Create symlink for git-list
ln -sf git-get git-list # Unix/Linux/macOS
# OR
copy git-get.exe git-list.exe # Windows
``` ```
Then add the `bin/` directory to your PATH. **Note:** The single binary (`git-get`) automatically detects how it's invoked and behaves as either `git-get` or `git-list` accordingly.
## Quick Start ## Quick Start

3
scripts/postinstall.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
# Create symlink for git-list command
ln -sf /usr/local/bin/git-get /usr/local/bin/git-list

3
scripts/preremove.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
# Remove symlink for git-list command
rm -f /usr/local/bin/git-list