fix: update order of yarn install & build commands and split yarn install & build targets
This commit is contained in:
parent
e5bfe9b9ab
commit
de03fd9ef7
@ -34,6 +34,7 @@ git clone https://github.com/JordanKnott/project-citadel && cd project-citadel
|
||||
Next we need to build the binary. This project uses [Mage](https://magefile.org/) for its build tool.
|
||||
|
||||
``` bash
|
||||
go run cmd/mage/main.go install
|
||||
go run cmd/mage/main.go build
|
||||
```
|
||||
|
||||
|
12
magefile.go
12
magefile.go
@ -21,11 +21,11 @@ var Aliases = map[string]interface{}{
|
||||
type Frontend mg.Namespace
|
||||
|
||||
func (Frontend) Install() error {
|
||||
return sh.Run("yarn", "install", "--cwd", "frontend")
|
||||
return sh.RunV("yarn", "--cwd", "frontend", "install")
|
||||
}
|
||||
|
||||
func (Frontend) Build() error {
|
||||
return sh.Run("yarn", "build", "--cwd", "frontend")
|
||||
return sh.RunV("yarn", "--cwd", "frontend", "build")
|
||||
}
|
||||
|
||||
type Backend mg.Namespace
|
||||
@ -44,6 +44,7 @@ func (Backend) GenFrontend() error {
|
||||
}
|
||||
|
||||
func (Backend) Build() error {
|
||||
fmt.Println("compiling binary dist/citadel")
|
||||
return sh.Run("go", "build", "-o", "dist/citadel", "cmd/citadel/main.go")
|
||||
}
|
||||
|
||||
@ -73,6 +74,9 @@ func (Backend) Schema() error {
|
||||
return sh.Run("gqlgen")
|
||||
}
|
||||
|
||||
func Build() {
|
||||
mg.SerialDeps(Frontend.Install, Frontend.Build, Backend.GenFrontend, Backend.Build)
|
||||
func Install() {
|
||||
mg.SerialDeps(Frontend.Install)
|
||||
}
|
||||
func Build() {
|
||||
mg.SerialDeps(Frontend.Build, Backend.GenFrontend, Backend.Build)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user