Read the file from the embedded FS instead of the real FS

master
Aadhavan Srinivasan 1 week ago
parent 565205fb5e
commit fd256bc7c7

@ -3,7 +3,6 @@ package main
import ( import (
"embed" "embed"
"errors" "errors"
"gitea.twomorecents.org/Rockingcool/ccat/stack"
"io/fs" "io/fs"
"os" "os"
"path/filepath" "path/filepath"
@ -11,6 +10,8 @@ import (
"runtime" "runtime"
"strings" "strings"
"gitea.twomorecents.org/Rockingcool/ccat/stack"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
) )
@ -49,7 +50,7 @@ func generateDefaultConfigs(configOutputPath string) error {
relPath, _ := filepath.Rel("config", path) relPath, _ := filepath.Rel("config", path)
dstPath := filepath.Join(configOutputPath, relPath) // Destination path dstPath := filepath.Join(configOutputPath, relPath) // Destination path
data, err := os.ReadFile(path) data, err := storedConfigs.ReadFile(path)
if err != nil { if err != nil {
return err return err
} }

Loading…
Cancel
Save