Skip to content

Commit 45e1ec8

Browse files
committed
bump version to 1.3.1
1 parent ce89eb8 commit 45e1ec8

7 files changed

+52
-5
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ ghorg
22
.env
33
debug
44
.DS_Store
5+
coverage.out

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55

6+
## [1.3.2] - unrealeased
7+
### Added
8+
### Changed
9+
### Deprecated
10+
### Removed
11+
### Fixed
12+
### Security
13+
14+
## [1.3.1] - 07/11/20
15+
### Added
16+
- ascii time output when users use ghorgignore
17+
- ascii time output when users use output-dir flag
18+
### Changed
19+
- default GHORG_ABSOLUTE_PATH_TO_CLONE_TO to $HOME/Desktop/ghorg
20+
### Deprecated
21+
### Removed
22+
### Fixed
23+
### Security
24+
625
## [1.3.0] - 07/11/20
726
### Added
827
- auto downcase of ghorg clone folder name; thanks @zamariola

cmd/clone.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func init() {
4646
rootCmd.PersistentFlags().StringVarP(&color, "color", "", "", "GHORG_COLOR - toggles colorful output on/off (default on)")
4747
rootCmd.AddCommand(cloneCmd)
4848
cloneCmd.Flags().StringVar(&protocol, "protocol", "", "GHORG_CLONE_PROTOCOL - protocol to clone with, ssh or https, (default https)")
49-
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/)")
49+
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)")
5050
cloneCmd.Flags().StringVarP(&branch, "branch", "b", "", "GHORG_BRANCH - branch left checked out for each repo cloned (default master)")
5151
cloneCmd.Flags().StringVarP(&token, "token", "t", "", "GHORG_GITHUB_TOKEN/GHORG_GITLAB_TOKEN/GHORG_BITBUCKET_APP_PASSWORD - scm token to clone with")
5252
cloneCmd.Flags().StringVarP(&bitbucketUsername, "bitbucket-username", "", "", "GHORG_BITBUCKET_USERNAME - bitbucket only: username associated with the app password")
@@ -487,6 +487,7 @@ func PrintConfigs() {
487487
colorlog.PrintInfo("* Branch : " + os.Getenv("GHORG_BRANCH"))
488488
colorlog.PrintInfo("* Location : " + os.Getenv("GHORG_ABSOLUTE_PATH_TO_CLONE_TO"))
489489
colorlog.PrintInfo("* Concurrency : " + os.Getenv("GHORG_CONCURRENCY"))
490+
490491
if os.Getenv("GHORG_SCM_BASE_URL") != "" {
491492
colorlog.PrintInfo("* Base URL : " + os.Getenv("GHORG_SCM_BASE_URL"))
492493
}
@@ -496,6 +497,13 @@ func PrintConfigs() {
496497
if os.Getenv("GHORG_BACKUP") == "true" {
497498
colorlog.PrintInfo("* Backup : " + os.Getenv("GHORG_BACKUP"))
498499
}
500+
if configs.GhorgIgnoreDetected() == true {
501+
colorlog.PrintInfo("* Ghorgignore : true")
502+
}
503+
if os.Getenv("GHORG_OUTPUT_DIR") != "" {
504+
colorlog.PrintInfo("* Output Dir : " + parentFolder + "_ghorg")
505+
}
506+
499507
colorlog.PrintInfo("*************************************")
500508
fmt.Println("")
501509
}

cmd/clone_test.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@ func TestShouldLowerRegularString(t *testing.T) {
1414

1515
func TestShouldNotChangeLowerCasedRegularString(t *testing.T) {
1616

17+
lowerName := "repo_name"
18+
parseParentFolder([]string{lowerName})
19+
20+
if parentFolder != "repo_name" {
21+
t.Errorf("Wrong folder name, expected: %s, got: %s", lowerName, parentFolder)
22+
}
23+
}
24+
25+
func TestReplaceDashWithUnderscore(t *testing.T) {
26+
1727
lowerName := "repo-name"
1828
parseParentFolder([]string{lowerName})
1929

20-
if parentFolder != "repo-name" {
30+
if parentFolder != "repo_name" {
2131
t.Errorf("Wrong folder name, expected: %s, got: %s", lowerName, parentFolder)
2232
}
2333
}

cmd/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ var versionCmd = &cobra.Command{
1515
Short: "Print the version number of Ghorg",
1616
Long: `All software has versions. This is Ghorg's`,
1717
Run: func(cmd *cobra.Command, args []string) {
18-
fmt.Println("1.3.0")
18+
fmt.Println("1.3.1")
1919
},
2020
}

configs/configs.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func getOrSetDefaults(envVar string) {
114114
if viper.GetString(envVar) == "" {
115115
switch envVar {
116116
case "GHORG_ABSOLUTE_PATH_TO_CLONE_TO":
117-
os.Setenv(envVar, HomeDir()+"/Desktop/")
117+
os.Setenv(envVar, HomeDir()+"/Desktop/ghorg/")
118118
case "GHORG_BRANCH":
119119
os.Setenv(envVar, "master")
120120
case "GHORG_CLONE_PROTOCOL":
@@ -151,6 +151,15 @@ func GhorgIgnoreLocation() string {
151151
return GhorgDir() + "/ghorgignore"
152152
}
153153

154+
// GhorgIgnoreDetected identify if a ghorgignore file exists in users .config/ghorg directory
155+
func GhorgIgnoreDetected() bool {
156+
_, err := os.Stat(GhorgIgnoreLocation())
157+
if os.IsNotExist(err) {
158+
return false
159+
}
160+
return true
161+
}
162+
154163
// GhorgDir returns the ghorg directory path
155164
func GhorgDir() string {
156165
if XConfigHomeSet() {

sample-conf.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ GHORG_SCM_TYPE:
6262
GHORG_CLONE_PROTOCOL:
6363

6464
# This is where your *_ghorg directory will be created, use absolute pathing. Must end with /, if not one will be added for you
65-
# default: $HOME/Desktop/
65+
# default: $HOME/Desktop/ghorg
6666
# flag (--path, -p)
6767
GHORG_ABSOLUTE_PATH_TO_CLONE_TO:
6868

0 commit comments

Comments
 (0)