diff --git a/cli/commands/bridge/bridge.go b/cli/commands/bridge/bridge.go index 5014ea9f..d3461edf 100644 --- a/cli/commands/bridge/bridge.go +++ b/cli/commands/bridge/bridge.go @@ -87,7 +87,7 @@ func btpBridgeCmd(diveContext *common.DiveContext) *cobra.Command { diveContext.FatalError("Chains Not Supported", "Supported Chains [icon,eth,hardhat]") } - diveContext.StopSpinner(fmt.Sprintf("BTP Bridge Setup Completed between %s and %s", chainA, chainB)) + diveContext.StopSpinner(fmt.Sprintf("BTP Bridge Setup Completed between %s and %s. Please find service details in current working directory(dive.json)", chainA, chainB)) }, } diff --git a/cli/commands/chain/types/eth.go b/cli/commands/chain/types/eth.go index 42084723..2b765c68 100644 --- a/cli/commands/chain/types/eth.go +++ b/cli/commands/chain/types/eth.go @@ -27,7 +27,7 @@ It establishes a connection to the Ethereum network and allows the node in execu if err != nil { diveContext.FatalError("Failed To Write To File", err.Error()) } - diveContext.StopSpinner("ETH Node Started") + diveContext.StopSpinner("ETH Node Started. Please find service details in current working directory(dive.json)") }, } diff --git a/cli/commands/chain/types/hardhat.go b/cli/commands/chain/types/hardhat.go index cabac9d5..11267763 100644 --- a/cli/commands/chain/types/hardhat.go +++ b/cli/commands/chain/types/hardhat.go @@ -28,7 +28,7 @@ It establishes a connection to the hardhat network and allows the node in execut if err != nil { diveContext.FatalError("Failed To Write To File", err.Error()) } - diveContext.StopSpinner("Hardhat Node Started") + diveContext.StopSpinner("Hardhat Node Started. Please find service details in current working directory(dive.json)") }, } diff --git a/cli/commands/chain/types/icon.go b/cli/commands/chain/types/icon.go index a1ca1dd2..0b9f9424 100644 --- a/cli/commands/chain/types/icon.go +++ b/cli/commands/chain/types/icon.go @@ -119,7 +119,7 @@ It establishes a connection to the Icon network and allows the node in executing diveContext.FatalError("Failed To Write To File", err.Error()) } - diveContext.StopSpinner("Icon Node Started") + diveContext.StopSpinner("Icon Node Started. Please find service details in current working directory(dive.json) in current working directory") } else { @@ -134,7 +134,7 @@ It establishes a connection to the Icon network and allows the node in executing diveContext.FatalError("Failed To Write To File", err.Error()) } - diveContext.StopSpinner("Icon Node Started") + diveContext.StopSpinner("Icon Node Started. Please find service details in current working directory(dive.json)") } }, @@ -168,7 +168,7 @@ func IconDecentralisationCmd(diveContext *common.DiveContext) *cobra.Command { diveContext.FatalError("Icon Node Decentralisation Failed", err.Error()) } - diveContext.StopSpinner(fmt.Sprintln("Decentralisation Completed ", response)) + diveContext.StopSpinner(fmt.Sprintln("Decentralisation Completed.Please find service details in dive.json", response)) }, } decentralisationCmd.Flags().StringVarP(&serviceName, "serviceName", "s", "", "service name") diff --git a/cli/common/types.go b/cli/common/types.go index 6adbf324..ce5e5cdb 100644 --- a/cli/common/types.go +++ b/cli/common/types.go @@ -152,7 +152,18 @@ func ReadConfigFile(filePath string) ([]byte, error) { return file, nil } func WriteToFile(data string) error { - file, err := os.Create("dive.json") + + pwd, err := os.Getwd() + + if err != nil { + return err + } + + file, err := os.OpenFile(pwd+"/dive.json", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) + if err != nil { + return err + } + if err != nil { return err }