outdirreponame should read just title from config.toml
This commit is contained in:
parent
73acd3a460
commit
f4b6837e36
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -70,14 +70,14 @@ func hugoLogs(logLines string, lines []string, hugoInstance string) string {
|
||||||
func getOutdir(tmpRepoPath, gitRepoPath string) string {
|
func getOutdir(tmpRepoPath, gitRepoPath string) string {
|
||||||
viper.SetConfigName("config")
|
viper.SetConfigName("config")
|
||||||
viper.SetConfigType("toml")
|
viper.SetConfigType("toml")
|
||||||
viper.AddConfigPath(filepath.Join(tmpRepoPath, "config", "_default"))
|
viper.AddConfigPath(filepath.Join(tmpRepoPath))
|
||||||
err := viper.ReadInConfig()
|
err := viper.ReadInConfig()
|
||||||
check(err)
|
check(err)
|
||||||
//outdirBasePath := viper.GetString("params.sandpointsOutputDirectory")
|
//outdirBasePath := viper.GetString("params.sandpointsOutputDirectory")
|
||||||
outdirChecksum := strconv.FormatUint(uint64(crc32.ChecksumIEEE([]byte(gitRepoPath))), 16)
|
outdirChecksum := strconv.FormatUint(uint64(crc32.ChecksumIEEE([]byte(gitRepoPath))), 16)
|
||||||
reg, err := regexp.Compile("[^a-zA-Z0-9]+")
|
reg, err := regexp.Compile("[^a-zA-Z0-9]+")
|
||||||
check(err)
|
check(err)
|
||||||
outdirRepoName := reg.ReplaceAllString(viper.GetString("params.title"), "")
|
outdirRepoName := reg.ReplaceAllString(viper.GetString("title"), "")
|
||||||
return strings.ToLower(outdirRepoName) + "-" + outdirChecksum
|
return strings.ToLower(outdirRepoName) + "-" + outdirChecksum
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue