Compare commits
2 Commits
1c229f1b3e
...
4eaead6abc
| Author | SHA1 | Date | |
|---|---|---|---|
| 4eaead6abc | |||
| 4abf2969ca |
@@ -2,6 +2,7 @@ package new
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fes/modules/config"
|
"fes/modules/config"
|
||||||
|
"fes/modules/ui"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@@ -114,5 +115,15 @@ All commands are run from the root of the project, from a terminal:
|
|||||||
## What to learn more?
|
## What to learn more?
|
||||||
|
|
||||||
Check out [Fes's docs](https://docs.vxserver.dev/static/fes.html).`, "$$", "`"), dir, dir)
|
Check out [Fes's docs](https://docs.vxserver.dev/static/fes.html).`, "$$", "`"), dir, dir)
|
||||||
|
|
||||||
|
ui.Hint("you can run this with `fes run %s`", dir)
|
||||||
|
|
||||||
|
fmt.Println("Created new Fes project at", func() string {
|
||||||
|
if res, err := filepath.Abs(dir); err == nil {
|
||||||
|
return res
|
||||||
|
}
|
||||||
|
return dir
|
||||||
|
}())
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ import (
|
|||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
hint_color = 0xbda02a
|
||||||
|
)
|
||||||
|
|
||||||
/* print out the current path (route) and relevant error */
|
/* print out the current path (route) and relevant error */
|
||||||
func Path(path string, err error) {
|
func Path(path string, err error) {
|
||||||
path = strings.TrimPrefix(path, "/")
|
path = strings.TrimPrefix(path, "/")
|
||||||
@@ -48,6 +52,16 @@ func Fatal(msg string, err error) error {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* print a useful hint to the user */
|
||||||
|
func Hint(format string, args ...any) {
|
||||||
|
color.RGB(func(hex int) (r, g, b int) {
|
||||||
|
r = (hex >> 16) & 0xFF
|
||||||
|
g = (hex >> 8) & 0xFF
|
||||||
|
b = hex & 0xFF
|
||||||
|
return
|
||||||
|
}(hint_color)).Printf("hint: %s\n", fmt.Sprintf(format, args...))
|
||||||
|
}
|
||||||
|
|
||||||
/* print message using the ok status color */
|
/* print message using the ok status color */
|
||||||
func OK(msg string) {
|
func OK(msg string) {
|
||||||
color.Green(msg)
|
color.Green(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user