@@ -3,7 +3,6 @@ package civo
33import (
44 "context"
55 "encoding/json"
6- "io/ioutil"
76 "os"
87
98 "github.com/1Password/shell-plugins/sdk"
@@ -50,7 +49,6 @@ func APIKey() schema.CredentialType {
5049 provision .AddArgs (
5150 "--config" , "{{.Path}}" ,
5251 ),
53- provision .AtFixedPath ("~/.civo.json" ),
5452 ),
5553 Importer : importer .TryAll (
5654 importer .TryEnvVarPair (defaultEnvVarMapping ),
@@ -63,31 +61,31 @@ func configFile(in sdk.ProvisionInput) ([]byte, error) {
6361 defaultRegion := in .ItemFields [fieldname .DefaultRegion ]
6462
6563 // Check if the file already exists
66- filePath := "~/.civo.json"
67- exists , err := fileExists (filePath )
68- if err != nil {
69- return nil , err
70- }
71-
72- if exists {
73- // Read the existing file
74- contents , err := ioutil .ReadFile (filePath )
75- if err != nil {
76- return nil , err
77- }
78-
79- var config Config
80- if err := json .Unmarshal (contents , & config ); err != nil {
81- return nil , err
82- }
83-
84- // Update the config with the new values
85- config .Properties [apiKeyID ] = json .RawMessage (`"` + apiKey + `"` )
86- config .Meta .CurrentAPIKey = apiKeyID
87- config .Meta .DefaultRegion = defaultRegion
88-
89- return json .MarshalIndent (config , "" , " " )
90- }
64+ // filePath := "~/.civo.json"
65+ // exists, err := fileExists(filePath)
66+ // if err != nil {
67+ // return nil, err
68+ // }
69+
70+ // if exists {
71+ // // Read the existing file
72+ // contents, err := ioutil.ReadFile(filePath)
73+ // if err != nil {
74+ // return nil, err
75+ // }
76+
77+ // var config Config
78+ // if err := json.Unmarshal(contents, &config); err != nil {
79+ // return nil, err
80+ // }
81+
82+ // // Update the config with the new values
83+ // config.Properties[apiKeyID] = json.RawMessage(`"` + apiKey + `"`)
84+ // config.Meta.CurrentAPIKey = apiKeyID
85+ // config.Meta.DefaultRegion = defaultRegion
86+
87+ // return json.MarshalIndent(config, "", " ")
88+ // }
9189
9290 // Create a new config
9391 config := Config {
0 commit comments