mirror of
https://github.com/gabrie30/ghorg.git
synced 2026-05-05 11:56:09 +02:00
auto add trailing slash to path to clone to
This commit is contained in:
parent
c9032b0854
commit
d0ce81dfc5
@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [Unreleased] - DATE
|
||||
### Added
|
||||
- auto add trailing slash to path to clone to if not supplied by user
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
|
||||
@ -123,7 +123,12 @@ func getOrSetDefaults(envVar string) {
|
||||
os.Setenv(envVar, "false")
|
||||
}
|
||||
} else {
|
||||
os.Setenv(envVar, viper.GetString(envVar))
|
||||
// User forgot to put a / at the end of path, so we will add for them
|
||||
if envVar == "GHORG_ABSOLUTE_PATH_TO_CLONE_TO" && !strings.HasSuffix(viper.GetString(envVar), "/") {
|
||||
os.Setenv(envVar, viper.GetString(envVar)+"/")
|
||||
} else {
|
||||
os.Setenv(envVar, viper.GetString(envVar))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
# This is where your *_ghorg directory will be created, use absolute pathing. Must end with /
|
||||
# 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/
|
||||
# flag (--path, -p)
|
||||
GHORG_ABSOLUTE_PATH_TO_CLONE_TO:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user