diff --git a/cmd/perfstand/account_create/main.go b/cmd/perfstand/account_create/main.go index c3915c566..a8c300253 100644 --- a/cmd/perfstand/account_create/main.go +++ b/cmd/perfstand/account_create/main.go @@ -34,7 +34,6 @@ func NewResults(networkMode string) internal.PerfResult { } } - func main() { prep := NewInput() err := internal.Prepare(prep, nil) @@ -89,13 +88,13 @@ func iterate(prep *input, result internal.PerfResult) error { return err } - var walletStr []byte + var cmd *exec.Cmd if runtime.GOOS == "windows" { - walletStr, err = exec.Command("powershell", "-Command", internal.GrpcWalletCreate(workspace)).Output() + cmd = exec.Command("powershell", "-Command", internal.GrpcWalletCreate(workspace)) } else { - walletStr, err = exec.Command("bash", "-c", internal.GrpcWalletCreate(workspace)).Output() + cmd = exec.Command("bash", "-c", internal.GrpcWalletCreate(workspace)) } - + walletStr, err := cmd.Output() if err != nil { return err } diff --git a/cmd/perfstand/internal/util.go b/cmd/perfstand/internal/util.go index d95e4ba43..e7e802e6c 100644 --- a/cmd/perfstand/internal/util.go +++ b/cmd/perfstand/internal/util.go @@ -176,7 +176,10 @@ func GrpcWorkspaceCreate() string { func GrpcAccountSelect(accHash, workspace, networkMode, staging string) string { if runtime.GOOS == "windows" { - staging, _ = WinFixPath(staging) + staging, err := WinFixPath(staging) + if err != nil { + return "Error: " + err.Error() + } return `cmd.exe /c 'grpcurl -import-path ../anytype-heart/ -proto pb/protos/service/service.proto -plaintext -d "{\"id\":\"` + accHash + `\",\"rootPath\":\"` + workspace + `\",\"disableLocalNetworkSync\":false,\"networkMode\":` + networkMode + `,\"networkCustomConfigFilePath\":\"` + staging + `\"}" localhost:31007 anytype.ClientCommands.AccountSelect'` } return `grpcurl -import-path ../anytype-heart/ -proto pb/protos/service/service.proto -plaintext -d '{ @@ -218,7 +221,10 @@ func GrpcWalletCreate(workspace string) string { func GrpcAccountCreate(workspace, networkMode, staging string) string { if runtime.GOOS == "windows" { - staging, _ = WinFixPath(staging) + staging, err := WinFixPath(staging) + if err != nil { + return "Error: " + err.Error() + } return `cmd.exe /c 'grpcurl -import-path ../anytype-heart/ -proto pb/protos/service/service.proto -plaintext -d "{\"icon\":13,\"networkMode\":` + networkMode + `,\"storePath\":\"` + workspace + `\",\"networkCustomConfigFilePath\":\"` + staging + `\"}" localhost:31007 anytype.ClientCommands.AccountCreate'` } return `grpcurl -import-path ../anytype-heart/ -proto pb/protos/service/service.proto -plaintext -d '{