mirror of
https://github.com/nvms/esr.git
synced 2025-12-13 06:10:52 +00:00
pre-copilot
This commit is contained in:
parent
d35e137872
commit
4041957a01
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
.aider*
|
||||
.env
|
||||
1
NextChange.md
Normal file
1
NextChange.md
Normal file
@ -0,0 +1 @@
|
||||
Fix --run with --watch - it does not watch correctly, and instead just exits.
|
||||
BIN
data/mcp-thought-server.sqlite
Normal file
BIN
data/mcp-thought-server.sqlite
Normal file
Binary file not shown.
@ -40,23 +40,30 @@ func (b *Builder) Build(buildOptions *api.BuildOptions) error {
|
||||
return fmt.Errorf("esr :: failed to create directory: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if err := os.WriteFile(file.Path, file.Contents, os.ModePerm); err != nil {
|
||||
return fmt.Errorf("esr :: failed to write file: %v", err)
|
||||
}
|
||||
|
||||
|
||||
// fmt.Printf("esr :: wrote: %s\n", filepath.Join(b.Config.Outdir, filepath.Base(file.Path)))
|
||||
fmt.Printf("esr :: wrote: %s\n", filepath.Join(filepath.Dir(file.Path), filepath.Base(file.Path)))
|
||||
// fmt.Printf("esr :: wrote: %s\n", file.Path)
|
||||
|
||||
|
||||
if filepath.Ext(file.Path) == ".js" {
|
||||
b.BuiltJS = append(b.BuiltJS, file.Path)
|
||||
}
|
||||
|
||||
|
||||
if filepath.Ext(file.Path) == ".css" {
|
||||
b.BuiltCSS = append(b.BuiltCSS, file.Path)
|
||||
}
|
||||
} else {
|
||||
dir := filepath.Dir(file.Path)
|
||||
if _, err := os.Stat(dir); os.IsNotExist(err) {
|
||||
if err := os.MkdirAll(dir, os.ModePerm); err != nil {
|
||||
return fmt.Errorf("esr :: failed to create directory: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := os.WriteFile(file.Path, file.Contents, os.ModePerm); err != nil {
|
||||
return fmt.Errorf("esr :: failed to write file: %v", err)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user