Skip to content

Commit

Permalink
fix: replace tab within cfg template with space
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanaden committed Sep 29, 2023
1 parent 0223d40 commit 39fa2b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package config

import (
"bytes"
"html/template"
"os"
"path/filepath"
"text/template"
"strings"

"github.com/pterm/pterm"
)
Expand All @@ -26,12 +27,13 @@ canvas_url: {{ .CanvasUrl }}
canvas_username: {{ .Username }}
# your canvas password
canvas_password: {{ .Password }}
# generated by canvas-sync (DO NOT EDIT)
# generated by canvas-sync
access_token: {{ .AccessToken }}
`

func GenerateConfigYaml(config *Config) string {
t, err := template.New("yaml generator").Parse(cfg_template)
cleanedTemplate := strings.ReplaceAll(cfg_template, "\t", " ")
t, err := template.New("yaml generator").Parse(cleanedTemplate)
if err != nil {
pterm.Error.Printfln("Error generating yaml generator: %s", err.Error())
}
Expand Down

0 comments on commit 39fa2b8

Please sign in to comment.