mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
bump version to 1.3.1
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@ ghorg
|
||||
.env
|
||||
debug
|
||||
.DS_Store
|
||||
coverage.out
|
||||
|
||||
19
CHANGELOG.md
19
CHANGELOG.md
@@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [1.3.2] - unrealeased
|
||||
### Added
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
### Security
|
||||
|
||||
## [1.3.1] - 07/11/20
|
||||
### Added
|
||||
- ascii time output when users use ghorgignore
|
||||
- ascii time output when users use output-dir flag
|
||||
### Changed
|
||||
- default GHORG_ABSOLUTE_PATH_TO_CLONE_TO to $HOME/Desktop/ghorg
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
### Security
|
||||
|
||||
## [1.3.0] - 07/11/20
|
||||
### Added
|
||||
- auto downcase of ghorg clone folder name; thanks @zamariola
|
||||
|
||||
10
cmd/clone.go
10
cmd/clone.go
@@ -46,7 +46,7 @@ func init() {
|
||||
rootCmd.PersistentFlags().StringVarP(&color, "color", "", "", "GHORG_COLOR - toggles colorful output on/off (default on)")
|
||||
rootCmd.AddCommand(cloneCmd)
|
||||
cloneCmd.Flags().StringVar(&protocol, "protocol", "", "GHORG_CLONE_PROTOCOL - protocol to clone with, ssh or https, (default https)")
|
||||
cloneCmd.Flags().StringVarP(&path, "path", "p", "", "GHORG_ABSOLUTE_PATH_TO_CLONE_TO - absolute path the ghorg_* directory will be created. Must end with / (default $HOME/Desktop/)")
|
||||
cloneCmd.Flags().StringVarP(&path, "path", "p", "", "GHORG_ABSOLUTE_PATH_TO_CLONE_TO - absolute path the ghorg_* directory will be created. Must end with / (default $HOME/Desktop/ghorg)")
|
||||
cloneCmd.Flags().StringVarP(&branch, "branch", "b", "", "GHORG_BRANCH - branch left checked out for each repo cloned (default master)")
|
||||
cloneCmd.Flags().StringVarP(&token, "token", "t", "", "GHORG_GITHUB_TOKEN/GHORG_GITLAB_TOKEN/GHORG_BITBUCKET_APP_PASSWORD - scm token to clone with")
|
||||
cloneCmd.Flags().StringVarP(&bitbucketUsername, "bitbucket-username", "", "", "GHORG_BITBUCKET_USERNAME - bitbucket only: username associated with the app password")
|
||||
@@ -487,6 +487,7 @@ func PrintConfigs() {
|
||||
colorlog.PrintInfo("* Branch : " + os.Getenv("GHORG_BRANCH"))
|
||||
colorlog.PrintInfo("* Location : " + os.Getenv("GHORG_ABSOLUTE_PATH_TO_CLONE_TO"))
|
||||
colorlog.PrintInfo("* Concurrency : " + os.Getenv("GHORG_CONCURRENCY"))
|
||||
|
||||
if os.Getenv("GHORG_SCM_BASE_URL") != "" {
|
||||
colorlog.PrintInfo("* Base URL : " + os.Getenv("GHORG_SCM_BASE_URL"))
|
||||
}
|
||||
@@ -496,6 +497,13 @@ func PrintConfigs() {
|
||||
if os.Getenv("GHORG_BACKUP") == "true" {
|
||||
colorlog.PrintInfo("* Backup : " + os.Getenv("GHORG_BACKUP"))
|
||||
}
|
||||
if configs.GhorgIgnoreDetected() == true {
|
||||
colorlog.PrintInfo("* Ghorgignore : true")
|
||||
}
|
||||
if os.Getenv("GHORG_OUTPUT_DIR") != "" {
|
||||
colorlog.PrintInfo("* Output Dir : " + parentFolder + "_ghorg")
|
||||
}
|
||||
|
||||
colorlog.PrintInfo("*************************************")
|
||||
fmt.Println("")
|
||||
}
|
||||
|
||||
@@ -14,10 +14,20 @@ func TestShouldLowerRegularString(t *testing.T) {
|
||||
|
||||
func TestShouldNotChangeLowerCasedRegularString(t *testing.T) {
|
||||
|
||||
lowerName := "repo_name"
|
||||
parseParentFolder([]string{lowerName})
|
||||
|
||||
if parentFolder != "repo_name" {
|
||||
t.Errorf("Wrong folder name, expected: %s, got: %s", lowerName, parentFolder)
|
||||
}
|
||||
}
|
||||
|
||||
func TestReplaceDashWithUnderscore(t *testing.T) {
|
||||
|
||||
lowerName := "repo-name"
|
||||
parseParentFolder([]string{lowerName})
|
||||
|
||||
if parentFolder != "repo-name" {
|
||||
if parentFolder != "repo_name" {
|
||||
t.Errorf("Wrong folder name, expected: %s, got: %s", lowerName, parentFolder)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ var versionCmd = &cobra.Command{
|
||||
Short: "Print the version number of Ghorg",
|
||||
Long: `All software has versions. This is Ghorg's`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("1.3.0")
|
||||
fmt.Println("1.3.1")
|
||||
},
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ func getOrSetDefaults(envVar string) {
|
||||
if viper.GetString(envVar) == "" {
|
||||
switch envVar {
|
||||
case "GHORG_ABSOLUTE_PATH_TO_CLONE_TO":
|
||||
os.Setenv(envVar, HomeDir()+"/Desktop/")
|
||||
os.Setenv(envVar, HomeDir()+"/Desktop/ghorg/")
|
||||
case "GHORG_BRANCH":
|
||||
os.Setenv(envVar, "master")
|
||||
case "GHORG_CLONE_PROTOCOL":
|
||||
@@ -151,6 +151,15 @@ func GhorgIgnoreLocation() string {
|
||||
return GhorgDir() + "/ghorgignore"
|
||||
}
|
||||
|
||||
// GhorgIgnoreDetected identify if a ghorgignore file exists in users .config/ghorg directory
|
||||
func GhorgIgnoreDetected() bool {
|
||||
_, err := os.Stat(GhorgIgnoreLocation())
|
||||
if os.IsNotExist(err) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// GhorgDir returns the ghorg directory path
|
||||
func GhorgDir() string {
|
||||
if XConfigHomeSet() {
|
||||
|
||||
@@ -62,7 +62,7 @@ GHORG_SCM_TYPE:
|
||||
GHORG_CLONE_PROTOCOL:
|
||||
|
||||
# This is where your *_ghorg directory will be created, use absolute pathing. Must end with /, if not one will be added for you
|
||||
# default: $HOME/Desktop/
|
||||
# default: $HOME/Desktop/ghorg
|
||||
# flag (--path, -p)
|
||||
GHORG_ABSOLUTE_PATH_TO_CLONE_TO:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user