Skip to content

Commit

Permalink
Fix Directory Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Alder Whiteford authored and Alder Whiteford committed Mar 6, 2024
1 parent c03963d commit 21ed818
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 114 deletions.
2 changes: 1 addition & 1 deletion cli/commands/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func BackendCommand() *cli.Command {

func RunBackend() error {
cmd := exec.Command("go", "run", "main.go")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
Expand Down
5 changes: 3 additions & 2 deletions cli/commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
var (
ROOT_DIR, _ = utils.GetRootDir()

Check failure on line 11 in cli/commands/config.go

View workflow job for this annotation

GitHub Actions / Lint

File is not `goimports`-ed (goimports)
FRONTEND_DIR = filepath.Join(ROOT_DIR, "/frontend")
BACKEND_DIR = filepath.Join(ROOT_DIR, "/backend/")
BACKEND_DIR = filepath.Join(ROOT_DIR, "/backend/")
BACKEND_SRC_DIR = filepath.Join(ROOT_DIR, "/backend/src")
CONFIG, _ = config.GetConfiguration(filepath.Join(ROOT_DIR, "/config"), false)
MIGRATION_FILE = filepath.Join(BACKEND_DIR, "/migrations/data.sql")
MIGRATION_FILE = filepath.Join(BACKEND_SRC_DIR, "/migrations/data.sql")
)
2 changes: 1 addition & 1 deletion cli/commands/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func InsertDB() error {

migrateCmd := exec.Command("go", "run", "main.go", "--only-migrate")

migrateCmd.Dir = BACKEND_DIR
migrateCmd.Dir = BACKEND_SRC_DIR

if err := migrateCmd.Run(); err != nil {
return fmt.Errorf("error running migration: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Migrate() error {
fmt.Println("Migrating database")

goCmd := exec.Command("go", "run", "main.go", "--only-migrate")
goCmd.Dir = BACKEND_DIR
goCmd.Dir = BACKEND_SRC_DIR

output, err := goCmd.CombinedOutput()
if err != nil {
Expand Down
6 changes: 3 additions & 3 deletions cli/commands/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func ResetData() error {
}

cmd := exec.Command("sleep", "1")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR

err = cmd.Run()
if err != nil {
Expand All @@ -65,7 +65,7 @@ func ResetData() error {
}

cmd = exec.Command("sleep", "1")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR

err = cmd.Run()
if err != nil {
Expand All @@ -91,7 +91,7 @@ func ResetMigration() error {
}

cmd := exec.Command("sleep", "1")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR

err = cmd.Run()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions cli/commands/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func SwaggerCommand() *cli.Command {
Usage: "Runs `swag init` to update Swagger documentation for the backend API",
Action: func(c *cli.Context) error {
cmd := exec.Command("swag", "init")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
Expand All @@ -31,7 +31,7 @@ func SwaggerCommand() *cli.Command {

func Swagger() error {
cmd := exec.Command("swag", "init")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR

out, err := cmd.CombinedOutput()
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func Test(folder string, runFrontend bool, runBackend bool) error {

func BackendTest() error {
cmd := exec.Command("go", "test", "./...")
cmd.Dir = BACKEND_DIR
cmd.Dir = BACKEND_SRC_DIR

out, err := cmd.CombinedOutput()
if err != nil {
Expand Down
104 changes: 1 addition & 103 deletions go.work.sum

Large diffs are not rendered by default.

0 comments on commit 21ed818

Please sign in to comment.