Skip to content

Commit

Permalink
fix: cosmetic changes (#7)
Browse files Browse the repository at this point in the history
* fix: cosmetic changes

* Fix typo
  • Loading branch information
isindir authored Jan 21, 2022
1 parent 1eebebf commit 689b7e7
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
28 changes: 24 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SHELL = /usr/bin/env bash -o pipefail
.SHELLFLAGS = -ec
GO := GOPROXY=https://proxy.golang.org go

VERSION:="0.0.9"
VERSION:="0.0.10"
EXE:="git-get"
BUILD:=`git rev-parse --short HEAD`
TIME:=`date`
Expand Down Expand Up @@ -32,12 +32,32 @@ build: ## Builds the binary file
-ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
-o ./bin/${EXE}-${VERSION}-osx main.go
-o ./bin/${EXE}-${VERSION}-osx-amd64 main.go
@GO111MODULE=on GOOS=darwin GOARCH=arm64 $(GO) build \
-ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
-o ./bin/${EXE}-${VERSION}-osx-arm64 main.go
@GO111MODULE=on GOOS=linux GOARCH=amd64 $(GO) build \
-ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
-o ./bin/${EXE}-${VERSION}-linux main.go
-o ./bin/${EXE}-${VERSION}-linux-amd64 main.go
@GO111MODULE=on GOOS=linux GOARCH=arm64 $(GO) build \
-ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
-o ./bin/${EXE}-${VERSION}-linux-arm64 main.go
@GO111MODULE=on GOOS=windows GOARCH=amd64 $(GO) build \
-ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
-o ./bin/${EXE}-${VERSION}-windows-amd64.exe main.go
@GO111MODULE=on GOOS=windows GOARCH=arm64 $(GO) build \
-ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
-o ./bin/${EXE}-${VERSION}-windows-arm64.exe main.go
@$(GO) build -ldflags="-X 'github.com/isindir/git-get/version.Version=v${VERSION}' \
-X 'github.com/isindir/git-get/version.Commit=${BUILD}' \
-X 'github.com/isindir/git-get/version.Time=${TIME}' " \
Expand Down Expand Up @@ -118,7 +138,7 @@ release: ## Release application
if [[ ! $$res -eq 0 ]]; then \
git tag -a $$version -m "git-tag $$version" ; \
git-chglog "$$version" > chglog.tmp ; \
hub release create -F chglog.tmp "$$version" -a bin/$${exe}-$${version}-linux -a bin/$${exe}-$${version}-osx ; \
hub release create -F chglog.tmp "$$version" -a ./bin/${EXE}-${VERSION}-osx-amd64 -a ./bin/${EXE}-${VERSION}-linux-amd64 -a ./bin/${EXE}-${VERSION}-osx-arm64 -a ./bin/${EXE}-${VERSION}-linux-arm64 -a ./bin/${EXE}-${VERSION}-windows-amd64.exe -a ./bin/${EXE}-${VERSION}-windows-arm64.exe ; \
rm -f chglog.tmp ; \
fi ; \
}
1 change: 1 addition & 0 deletions bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func CreateRepository(repoSha, repository, mirrorVisibilityMode, sourceURL, proj
return resultingRepository
}

// FetchOwnerRepos - fetch owner repositories via API
func FetchOwnerRepos(repoSha, owner, bitbucketRole string) []bitbucket.Repository {
log.Debugf("%s: Specified owner: '%s'", repoSha, owner)
var reposToReutrn []bitbucket.Repository
Expand Down
5 changes: 4 additions & 1 deletion gitget/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ var bitbucketMirrorProject = ""
var colorHighlight *color.Color
var colorRef *color.Color

// ConfigGenParamsStruct - data structure to store parameters passed via cli flags
type ConfigGenParamsStruct struct {
// Gitlab specific vars
GitlabOwned bool
Expand Down Expand Up @@ -206,6 +207,7 @@ func (repo *Repo) PrepareForGet() {
log.Debugf("%s: Repository structure: '%+v'", repo.sha, repo)
}

// PrepareForMirror - set repository structure fields for mirror operation
func (repo *Repo) PrepareForMirror(pathPrefix string, mirrorRootURL string) {
repo.SetTempRepoPathForMirror(pathPrefix)
repo.SetDefaultRef()
Expand Down Expand Up @@ -976,7 +978,7 @@ func GetIgnoreRepoList(ignoreFile string) []Repo {

yamlIgnoreFile, err := ioutil.ReadFile(ignoreFile)
if err != nil {
log.Warnf("Ignore file missing %s: %s", ignoreFile, err)
log.Warnf("Ignoring missing file: %s", err)
return ignoreRepoList
}

Expand All @@ -1001,6 +1003,7 @@ func GenerateGitfileConfig(
var repoList []Repo

ignoreRepoList := GetIgnoreRepoList(ignoreFile)
gitProvider = gitCloudProvider

switch gitCloudProvider {
case "github":
Expand Down
1 change: 1 addition & 0 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ func fetchUserRepos(
return repoList
}

// FetchOwnerRepos - fetch owner repositories via API, being it Organization or User
func FetchOwnerRepos(
ctx context.Context,
repoSha, owner, githubVisibility, githubAffiliation string,
Expand Down

0 comments on commit 689b7e7

Please sign in to comment.