You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 16, 2023. It is now read-only.
message:=fmt.Sprintf("Welcome %s! This is your first secret. To write a new version of this secret, run:\n\n secrethub write %s", fullName, secretPath)
createWorkspace, err:=ui.AskYesNo(io, "Do you want to create a shared workspace for your team?", ui.DefaultYes)
310
+
iferr!=nil {
311
+
returnerr
312
+
}
313
+
fmt.Fprintln(io.Output())
314
+
if!createWorkspace {
315
+
fmt.Fprint(io.Output(), "You can create a shared workspace later using `secrethub org init`.\n\n")
316
+
returnnil
317
+
}
318
+
}
319
+
320
+
varerrerror
321
+
iforg=="" {
322
+
org, err=ui.AskAndValidate(io, "Workspace name (e.g. your company name): ", 2, api.ValidateOrgName)
323
+
iferr!=nil {
324
+
returnerr
325
+
}
326
+
}
327
+
iforgDescription=="" {
328
+
orgDescription, err=ui.AskAndValidate(io, "A description (max 144 chars) for your team workspace so others will recognize it:\n", 2, api.ValidateOrgDescription)
329
+
iferr!=nil {
330
+
returnerr
331
+
}
332
+
}
333
+
334
+
fmt.Fprint(io.Output(), "Creating your shared workspace...")
335
+
progressPrinter.Start()
336
+
337
+
_, err=client.Orgs().Create(org, orgDescription)
338
+
progressPrinter.Stop()
339
+
iferr==api.ErrOrgAlreadyExists {
340
+
fmt.Fprintf(io.Output(), "The workspace %s already exists. If it is your organization, ask a colleague to invite you to the workspace. You can also create a new one using `secrethub org init`.\n", org)
341
+
} elseiferr!=nil {
342
+
returnerr
343
+
} else {
344
+
fmt.Fprint(io.Output(), "Created your shared workspace.\n\n")
345
+
}
346
+
returnnil
347
+
}
348
+
349
+
// writeCredential writes the given credential to the configuration directory.
returnui.AskPassphrase(io, "Please enter a passphrase to protect your local credential (leave empty for no passphrase): ", "Enter the same passphrase again: ", 3)
0 commit comments