mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
chore: update cmd entry folder
This commit is contained in:
parent
805ab9996e
commit
8ce1d21c2a
@ -17,7 +17,7 @@ WORKDIR /backend-build
|
|||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=frontend /frontend-build/dist ./server/dist
|
COPY --from=frontend /frontend-build/dist ./server/dist
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 go build -o shortify ./main.go
|
RUN go build -o shortify ./cmd/shortify/main.go
|
||||||
|
|
||||||
# Make workspace with above generated files.
|
# Make workspace with above generated files.
|
||||||
FROM alpine:3.16 AS monolithic
|
FROM alpine:3.16 AS monolithic
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package cmd
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
_ "modernc.org/sqlite"
|
||||||
|
|
||||||
"github.com/boojack/shortify/server"
|
"github.com/boojack/shortify/server"
|
||||||
_profile "github.com/boojack/shortify/server/profile"
|
_profile "github.com/boojack/shortify/server/profile"
|
||||||
@ -127,3 +128,10 @@ func initConfig() {
|
|||||||
println("version:", profile.Version)
|
println("version:", profile.Version)
|
||||||
println("---")
|
println("---")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
err := Execute()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
14
main.go
14
main.go
@ -1,14 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "modernc.org/sqlite"
|
|
||||||
|
|
||||||
"github.com/boojack/shortify/cmd"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
err := cmd.Execute()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,7 +3,7 @@ tmp_dir = ".air"
|
|||||||
|
|
||||||
[build]
|
[build]
|
||||||
bin = "./.air/shortify"
|
bin = "./.air/shortify"
|
||||||
cmd = "go build -o ./.air/shortify ./main.go"
|
cmd = "go build -o ./.air/shortify ./cmd/shortify/main.go"
|
||||||
delay = 1000
|
delay = 1000
|
||||||
exclude_dir = [".air", "web", "build"]
|
exclude_dir = [".air", "web", "build"]
|
||||||
exclude_file = []
|
exclude_file = []
|
||||||
|
@ -8,6 +8,6 @@ cd "$(dirname "$0")/../"
|
|||||||
|
|
||||||
echo "Start building backend..."
|
echo "Start building backend..."
|
||||||
|
|
||||||
go build -o ./build/shortify ./main.go
|
go build -o ./build/shortify ./cmd/shortify/main.go
|
||||||
|
|
||||||
echo "Backend built!"
|
echo "Backend built!"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user