-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
12efb8b
commit 814e1ec
Showing
13 changed files
with
189 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
" ",Mac,Windows,Linux | ||
`wails init`,:material-check-bold:,:material-check-bold:,:material-check-bold: | ||
`wails build`,:material-check-bold:,:material-check-bold:,:material-check-bold: | ||
`wails dev`," "," "," " | ||
`wails dev`," ",:material-check-bold:," " | ||
`wails package`," ",:material-check-bold:,:material-check-bold: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build production | ||
|
||
package assetserver | ||
|
||
func GetDevServerURL() string { | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package commands | ||
|
||
import ( | ||
"github.com/atterpac/refresh/engine" | ||
"strings" | ||
) | ||
|
||
type WatcherOptions struct { | ||
Path string `description:"The path to watch" default:"."` | ||
PreExec string `description:"The command to run before the main command"` | ||
Exec string `description:"The command to run when a change is detected"` | ||
PostExec string `description:"The command to run after the main command"` | ||
IgnoreFiles string `description:"The files to ignore (comma separated)"` | ||
IgnoreDirs string `description:"The directories to ignore (comma separated)"` | ||
IgnoreExtensions string `description:"The extensions to ignore (comma separated)"` | ||
Debounce int `description:"The debounce time in milliseconds" default:"1000"` | ||
PreWait bool `description:"Wait for the pre-exec command to finish before running the main command"` | ||
} | ||
|
||
func Watcher(options *WatcherOptions) error { | ||
|
||
ignore := engine.Ignore{ | ||
File: strings.Split(options.IgnoreFiles, ","), | ||
Dir: strings.Split(options.IgnoreDirs, ","), | ||
Extension: strings.Split(options.IgnoreExtensions, ","), | ||
} | ||
config := engine.Config{ | ||
RootPath: options.Path, | ||
PreExec: options.PreExec, | ||
ExecCommand: options.Exec, | ||
PostExec: options.PostExec, | ||
Ignore: ignore, | ||
LogLevel: "info", | ||
Debounce: options.Debounce, | ||
PreWait: options.PreWait, | ||
} | ||
|
||
watch := engine.NewEngineFromConfig(config) | ||
|
||
watch.Start() | ||
<-make(chan struct{}) | ||
return nil | ||
} |
Oops, something went wrong.