MCPcopy Create free account
hub / github.com/vale-cli/vale / initPath

Function initPath

cmd/vale/sync.go:15–33  ·  view source on GitHub ↗
(cfg *core.Config)

Source from the content-addressed store, hash-verified

13)
14
15func initPath(cfg *core.Config) error {
16 // The first entry is always the default `StylesPath`.
17 stylesPath := cfg.StylesPath()
18
19 if !system.IsDir(stylesPath) {
20 if err := os.MkdirAll(stylesPath, os.ModePerm); err != nil {
21 e := fmt.Errorf("unable to initialize StylesPath (value = '%s')", stylesPath)
22 return core.NewE100("initPath", e)
23 }
24 }
25
26 // Remove any existing .vale-config directory.
27 err := os.RemoveAll(filepath.Join(stylesPath, core.PipeDir))
28 if err != nil {
29 return core.NewE100("initPath", err)
30 }
31
32 return nil
33}
34
35func readPkg(pkg, path string, idx int) error {
36 if core.IsPhrase(pkg) && !system.IsDir(pkg) {

Callers 2

mockPathFunction · 0.85
syncFunction · 0.85

Calls 3

IsDirFunction · 0.92
NewE100Function · 0.92
StylesPathMethod · 0.80

Tested by 1

mockPathFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…