diff --git a/cli/commands/chain/types/archway.go b/cli/commands/chain/types/archway.go index 490cd6f2..cca19313 100644 --- a/cli/commands/chain/types/archway.go +++ b/cli/commands/chain/types/archway.go @@ -69,10 +69,10 @@ func NewArchwayCmd(diveContext *common.DiveContext) *cobra.Command { common.WriteToServiceFile(runResponse.ServiceName, *runResponse) - diveContext.StopSpinner("Archyway Node Started. Please find service details in current working directory(services.json)") + diveContext.StopSpinner("Archway Node Started. Please find service details in current working directory(services.json)") }, } - archwayCmd.Flags().StringVarP(&config, "config", "c", "", "provide config to start archway node ") + archwayCmd.Flags().StringVarP(&config, "config", "c", "", "path to custom config json file to start archway node ") return archwayCmd } @@ -170,12 +170,14 @@ func runArchwayWithDefaultServiceConfig(diveContext *common.DiveContext, enclave } - nodeServiceResponseData, _, _, err := diveContext.GetSerializedData(nodeServiceResponse) + nodeServiceResponseData, services, skippedInstructions, err := diveContext.GetSerializedData(nodeServiceResponse) if err != nil { - return "", err + diveContext.StopServices(services) + diveContext.FatalError("Starlark Run Failed", err.Error()) } + diveContext.CheckInstructionSkipped(skippedInstructions, "Archway Node Already Running") return nodeServiceResponseData, nil } diff --git a/cli/common/constants.go b/cli/common/constants.go index 4bf17e8a..790bdb48 100644 --- a/cli/common/constants.go +++ b/cli/common/constants.go @@ -3,7 +3,7 @@ package common var DiveLogs bool // !!!!!!!!!!! DO NOT UPDATE! WILL BE UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!! -var DiveVersion = "v0.0.8-beta" +var DiveVersion = "v0.0.9-beta" const ( DiveEnclave = "dive" diff --git a/cli/common/types.go b/cli/common/types.go index f296ccc9..7a3d6024 100644 --- a/cli/common/types.go +++ b/cli/common/types.go @@ -212,42 +212,28 @@ func WriteToServiceFile(serviceName string, data DiveserviceResponse) error { return err } - if len(jsonDataFromFile) != 0 { - _, ok := jsonDataFromFile[serviceName] - if !ok { - jsonDataFromFile[serviceName] = &data - dataTowrite, err := json.Marshal(jsonDataFromFile) - if err != nil { - return err - } - - _, err = file.WriteAt(dataTowrite, 0) - - if err != nil { - return err - } - - return nil - } - + if len(jsonDataFromFile) == 0 { + jsonDataFromFile = Services{} } - newServices := Services{} - newServices[serviceName] = &data + var dataToWrite []byte - dataTowrite, err := json.Marshal(newServices) - if err != nil { - return err + _, ok := jsonDataFromFile[serviceName] + if !ok { + jsonDataFromFile[serviceName] = &data + dataToWrite, err = json.Marshal(jsonDataFromFile) + if err != nil { + return err + } } - _, err = file.Write(dataTowrite) + _, err = file.Write(dataToWrite) if err != nil { return err } return nil - } func ReadServiceJsonFile() (Services, error) { diff --git a/cli/go.mod b/cli/go.mod index abffd7e1..fdb54e57 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -6,7 +6,7 @@ require ( github.com/briandowns/spinner v1.23.0 github.com/fatih/color v1.15.0 github.com/google/go-github v17.0.0+incompatible - github.com/kurtosis-tech/kurtosis/api/golang v0.82.5 + github.com/kurtosis-tech/kurtosis/api/golang v0.82.6 github.com/kurtosis-tech/stacktrace v0.0.0-20211028211901-1c67a77b5409 github.com/natefinch/lumberjack v2.0.0+incompatible github.com/sirupsen/logrus v1.9.3