代码拉取完成,页面将自动刷新
同步操作将从 开源中国/git-repo-clean 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
TARGET := git-repo-clean
VERSION := 1.0.4
GO_VERSION := $(subst go version go,,$(shell go version))
BUILD_VERSION := $(shell git describe --tags --always)
GO_LDFLAGS := -X 'main.GoVersion=$(GO_VERSION)' -X 'main.BuildVersion=$(BUILD_VERSION)'
GOFLAGS := -ldflags "$(GO_LDFLAGS)"
.PHONY: all
all:
go build -o bin/${TARGET} $(GOFLAGS)
.PHONY: release
release: Linux MacOS Windows
Linux: Linux-64 Linux-32
Linux-64:
mkdir -p releases/$(VERSION)/Linux-64/
cp -r docs releases/$(VERSION)/Linux-64/
cp LICENSE releases/$(VERSION)/Linux-64/
cp README.md releases/$(VERSION)/Linux-64/
$(call RELEASE_BUILD,linux,amd64)
cp ./releases/git-repo-clean releases/$(VERSION)/Linux-64/
tar -cf releases/git-repo-clean-$(VERSION)-Linux-64.tar releases/$(VERSION)/Linux-64/
rm releases/git-repo-clean
rm -rf releases/$(VERSION)/Linux-64
Linux-32:
mkdir -p releases/$(VERSION)/Linux-32/
cp -r docs releases/$(VERSION)/Linux-32/
cp LICENSE releases/$(VERSION)/Linux-32/
cp README.md releases/$(VERSION)/Linux-32/
$(call RELEASE_BUILD,linux,386)
cp ./releases/git-repo-clean releases/$(VERSION)/Linux-32/
tar -cf releases/git-repo-clean-$(VERSION)-Linux-32.tar releases/$(VERSION)/Linux-32/
rm releases/git-repo-clean
rm -rf releases/$(VERSION)/Linux-32/
MacOS: macOS-64
macOS-64:
mkdir -p releases/$(VERSION)/macOS-64/
cp -r docs releases/$(VERSION)/macOS-64/
cp LICENSE releases/$(VERSION)/macOS-64/
cp README.md releases/$(VERSION)/macOS-64/
$(call RELEASE_BUILD,darwin,amd64)
cp ./releases/git-repo-clean releases/$(VERSION)/macOS-64/
tar -cf releases/git-repo-clean-$(VERSION)-macOS-64.tar releases/$(VERSION)/macOS-64/
rm releases/git-repo-clean
rm -rf releases/$(VERSION)/macOS-64/
Windows: Windows-64 Windows-32
Windows-64:
mkdir -p releases/$(VERSION)/Windows-64/
cp -r docs releases/$(VERSION)/Windows-64/
cp LICENSE releases/$(VERSION)/Windows-64/
cp README.md releases/$(VERSION)/Windows-64/
$(call RELEASE_BUILD,windows,amd64,.exe)
cp ./releases/git-repo-clean.exe releases/$(VERSION)/Windows-64/
zip -r releases/git-repo-clean-$(VERSION)-Windows-64.zip releases/$(VERSION)/Windows-64/
rm releases/git-repo-clean.exe
rm -rf releases/$(VERSION)/Windows-64/
Windows-32:
mkdir -p releases/$(VERSION)/Windows-32/
cp -r docs releases/$(VERSION)/Windows-32/
cp LICENSE releases/$(VERSION)/Windows-32/
cp README.md releases/$(VERSION)/Windows-32/
$(call RELEASE_BUILD,windows,386,.exe)
cp ./releases/git-repo-clean.exe releases/$(VERSION)/Windows-32/
zip -r releases/git-repo-clean-$(VERSION)-Windows-32.zip releases/$(VERSION)/Windows-32/
rm releases/git-repo-clean.exe
rm -rf releases/$(VERSION)/Windows-32/
RELEASE_BUILD = GOOS=$(1) GOARCH=$(2) \
go build \
$(GOFLAGS) \
-o ./releases/git-repo-clean$(3)
.PHONY: clean
clean:
rm -f bin/git-repo-clean
rm -rf releases/*
.PHONY: install
install:
cp bin/git-repo-clean $(shell git --exec-path)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。