Skip to content

Commit

Permalink
Changed trcsub error message for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
meghan-bailey committed Jul 10, 2024
1 parent 5038179 commit 618df03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/trcinit/initlib/vsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ func DownloadTemplates(config *core.CoreConfig, mod *helperkv.Modifier, dirName
if len(*templatePaths) > 0 {
filterTemplatePathSlice = strings.Split(*templatePaths, ",")
}

for _, filterTemplatePath := range filterTemplatePathSlice {
path := filterTemplatePath
ext := ""
if strings.Contains(path, "Common") {
if !strings.Contains(path, ".") {
eUtils.LogErrorMessage(config, "Expecting file extension with filepath", false)
fmt.Println("Expecting file extension with filepath: " + path)
if eUtils.IsWindows() {
fmt.Println("Make sure filepath is in quotes.")
}
}
}
if !strings.HasSuffix(filterTemplatePath, "/") {
Expand Down Expand Up @@ -69,6 +71,9 @@ func DownloadTemplates(config *core.CoreConfig, mod *helperkv.Modifier, dirName
}
//create new file
templateFile := fmt.Sprintf("%s/%s%s.tmpl", dirPath, file, ext)
if eUtils.IsWindows() {
templateFile = fmt.Sprintf("%s\\%s%s.tmpl", dirPath, file, ext)
}
newFile, err := os.Create(templateFile)
if err != nil {
eUtils.LogErrorMessage(config, fmt.Sprintf("Couldn't create file: %s", templateFile), false)
Expand Down

0 comments on commit 618df03

Please sign in to comment.