Skip to content

Commit 31f2565

Browse files
authored
Merge pull request #175 from shelltime/fix/config-optional-endpoints-schema-path
fix(config): make endpoints optional and use relative schema path
2 parents 5ecb760 + 35ffcde commit 31f2565

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

commands/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func commandAuth(c *cli.Context) error {
4545
SetupLogger(configDir)
4646

4747
// Generate JSON schema for IDE autocompletion
48-
schemaFile := configDir + "/config.schema.json"
48+
schemaFile := configDir + "/config-schema.json"
4949
if err := generateSchemaFile(schemaFile); err != nil {
5050
slog.Warn("Failed to generate schema file", slog.Any("err", err))
5151
}
@@ -58,7 +58,7 @@ func commandAuth(c *cli.Context) error {
5858
return fmt.Errorf("failed to marshal default config: %w", err)
5959
}
6060
// Prepend $schema for IDE autocompletion support
61-
schemaHeader := "# yaml-language-server: $schema=" + schemaFile + "\n"
61+
schemaHeader := "# yaml-language-server: $schema=./config-schema.json\n"
6262
content = append([]byte(schemaHeader), content...)
6363
err = os.WriteFile(configFile, content, 0644)
6464
if err != nil {

model/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ type ShellTimeConfig struct {
6060
DataMasking *bool `toml:"dataMasking" yaml:"dataMasking" json:"dataMasking"`
6161

6262
// for debug purpose
63-
Endpoints []Endpoint `toml:"ENDPOINTS" yaml:"endpoints" json:"endpoints"`
63+
Endpoints []Endpoint `toml:"ENDPOINTS,omitempty" yaml:"endpoints,omitempty" json:"endpoints,omitempty"`
6464

6565
// WARNING
6666
// This config will track each command metrics you run in current shell.

0 commit comments

Comments
 (0)