outdirreponame should read just title from config.toml

master
Marcell Mars 3 years ago
parent 73acd3a460
commit f4b6837e36

@ -70,14 +70,14 @@ func hugoLogs(logLines string, lines []string, hugoInstance string) string {
func getOutdir(tmpRepoPath, gitRepoPath string) string {
viper.SetConfigName("config")
viper.SetConfigType("toml")
viper.AddConfigPath(filepath.Join(tmpRepoPath, "config", "_default"))
viper.AddConfigPath(filepath.Join(tmpRepoPath))
err := viper.ReadInConfig()
check(err)
//outdirBasePath := viper.GetString("params.sandpointsOutputDirectory")
outdirChecksum := strconv.FormatUint(uint64(crc32.ChecksumIEEE([]byte(gitRepoPath))), 16)
reg, err := regexp.Compile("[^a-zA-Z0-9]+")
check(err)
outdirRepoName := reg.ReplaceAllString(viper.GetString("params.title"), "")
outdirRepoName := reg.ReplaceAllString(viper.GetString("title"), "")
return strings.ToLower(outdirRepoName) + "-" + outdirChecksum
}

Loading…
Cancel
Save