diff --git a/cmd/ftl/cmd_config.go b/cmd/ftl/cmd_config.go index f43901936e..59a9ee4272 100644 --- a/cmd/ftl/cmd_config.go +++ b/cmd/ftl/cmd_config.go @@ -9,10 +9,11 @@ import ( "connectrpc.com/connect" + "github.com/alecthomas/types/optional" + "github.com/TBD54566975/ftl/backend/controller/admin" ftlv1 "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1" cf "github.com/TBD54566975/ftl/common/configuration" - "github.com/alecthomas/types/optional" ) type configCmd struct { @@ -91,13 +92,7 @@ func (s *configGetCmd) Run(ctx context.Context, adminClient admin.Client) error if err != nil { return err } - - var value any - err = json.Unmarshal(resp.Msg.Value, &value) - if err != nil { - return fmt.Errorf("%s: %w", s.Ref, err) - } - fmt.Println(value) + fmt.Printf("%s\n", resp.Msg.Value) return nil } diff --git a/cmd/ftl/cmd_secret.go b/cmd/ftl/cmd_secret.go index e185bccb57..a2ffa1dc70 100644 --- a/cmd/ftl/cmd_secret.go +++ b/cmd/ftl/cmd_secret.go @@ -94,12 +94,7 @@ func (s *secretGetCmd) Run(ctx context.Context, adminClient admin.Client) error if err != nil { return err } - - var value any - if err := json.Unmarshal(resp.Msg.Value, &value); err != nil { - return fmt.Errorf("%s: %w", s.Ref, err) - } - fmt.Println(value) + fmt.Printf("%s\n", resp.Msg.Value) return nil } diff --git a/common/projectconfig/integration_test.go b/common/projectconfig/integration_test.go index 8414b7e265..a9ea3ee29a 100644 --- a/common/projectconfig/integration_test.go +++ b/common/projectconfig/integration_test.go @@ -8,8 +8,9 @@ import ( "path/filepath" "testing" - in "github.com/TBD54566975/ftl/integration" "github.com/alecthomas/assert/v2" + + in "github.com/TBD54566975/ftl/integration" ) func TestCmdsCreateProjectTomlFilesIfNonexistent(t *testing.T) { @@ -46,6 +47,6 @@ func TestDefaultToRootWhenModuleDirsMissing(t *testing.T) { func TestConfigCmdWithoutController(t *testing.T) { in.RunWithoutController(t, "configs-ftl-project.toml", - in.ExecWithExpectedOutput("value\n", "ftl", "config", "get", "key"), + in.ExecWithExpectedOutput("\"value\"\n", "ftl", "config", "get", "key"), ) } diff --git a/common/projectconfig/projectconfig.go b/common/projectconfig/projectconfig.go index dc393e9cfc..dfa65c3b19 100644 --- a/common/projectconfig/projectconfig.go +++ b/common/projectconfig/projectconfig.go @@ -136,21 +136,6 @@ func loadFile(path string) (Config, error) { } return Config{}, fmt.Errorf("unknown configuration keys: %s", strings.Join(keys, ", ")) } - - // make modules-dir absolute to mimic the behavior of the CLI - for i, dir := range config.ModuleDirs { - if !filepath.IsAbs(dir) { - config.ModuleDirs[i] = filepath.Join(filepath.Dir(path), dir) - } - } - - // make external-dirs absolute to mimic the behavior of the CLI - for i, dir := range config.ExternalDirs { - if !filepath.IsAbs(dir) { - config.ExternalDirs[i] = filepath.Join(filepath.Dir(path), dir) - } - } - return config, nil } diff --git a/common/projectconfig/projectconfig_test.go b/common/projectconfig/projectconfig_test.go index f44ca5e87f..c9fb9fdfe2 100644 --- a/common/projectconfig/projectconfig_test.go +++ b/common/projectconfig/projectconfig_test.go @@ -25,8 +25,8 @@ func TestProjectConfig(t *testing.T) { }, }, }, - ModuleDirs: []string{"testdata/a/b/c", "testdata/d"}, - ExternalDirs: []string{"testdata/e/f", "testdata/g/h"}, + ModuleDirs: []string{"a/b/c", "d"}, + ExternalDirs: []string{"e/f", "g/h"}, Commands: Commands{ Startup: []string{"echo 'Executing global pre-build command'"}, },