diff --git a/cmd/deploy.go b/cmd/deploy.go index 2c2daf9..67aa6da 100644 --- a/cmd/deploy.go +++ b/cmd/deploy.go @@ -85,7 +85,7 @@ func runDeploy(cmd *cobra.Command, args []string) error { return errors.New("already in a roxie sub-shell (ROXIE_SHELL environment variable is set), please exit the shell and try again") } - if !env.RunningInteractively && envrc == "" { + if components.IncludesCentral() && !env.RunningInteractively && envrc == "" { return errors.New("running without a controlling terminal requires --envrc to be set") } @@ -179,7 +179,6 @@ func runDeploy(cmd *cobra.Command, args []string) error { } if envrc != "" { - log.Dimf("Writing environment variables to %s", envrc) d.SetEnvrcFile(envrc) } diff --git a/internal/deployer/deployer.go b/internal/deployer/deployer.go index 489d5dc..82860dc 100644 --- a/internal/deployer/deployer.go +++ b/internal/deployer/deployer.go @@ -640,6 +640,7 @@ func (d *Deployer) deployCentral(ctx context.Context, resources, exposure string // envrc may be used from different processes, so use actual endpoint not port-forward if d.envrcFile != "" { + d.logger.Dimf("Writing environment variables to %s", d.envrcFile) if err := d.writeEnvrcFile(ctx, exposure, portForwardWanted); err != nil { d.logger.Warningf("Failed to write envrc file: %v", err) }