mirror of
https://github.com/railwayapp/cli
synced 2026-04-21 14:07:23 +00:00
* Add Linting for CLI * Fire CI * Remove checkout oopsie * Newlint * Clean modcache for now * Lint fixes * Fix failed to write error * Fix CI issues * Workflow comments * Fix print lint errs * Fix * Fix lint issues * Update cmd/build.go Co-authored-by: Jake Runzer <jakerunzer@gmail.com> * Update cmd/whoami.go Co-authored-by: Jake Runzer <jakerunzer@gmail.com> Co-authored-by: Jake Runzer <jakerunzer@gmail.com>
24 lines
522 B
Go
24 lines
522 B
Go
package cmd
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
|
|
"github.com/railwayapp/cli/entity"
|
|
)
|
|
|
|
func (h *Handler) Build(ctx context.Context, req *entity.CommandRequest) error {
|
|
if h.cfg.RailwayProductionToken == "" {
|
|
fmt.Println("Railway env file is only generated in production")
|
|
return nil
|
|
}
|
|
|
|
err := h.ctrl.SaveEnvsToFile(ctx)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Printf(`Env written to %s
|
|
Do NOT commit the env.json file. This command should only be run as a production build step.\n`, h.cfg.RailwayEnvFilePath)
|
|
return nil
|
|
}
|