DenReg/cli/commands/setup.ts
2020-07-28 19:43:58 +02:00

30 lines
876 B
TypeScript

import { Cliffy } from "../deps.ts";
import { getConfig, setConfig } from "../global.ts";
export default async function setup() {
const registry = await Cliffy.Input.prompt({
message: "What's your registry?",
default: getConfig("registry"),
});
const username = await Cliffy.Input.prompt({
message: "What's your username?",
default: getConfig("username"),
});
const password = await Cliffy.Secret.prompt({
message: "What's your password?",
hidden: true,
default: getConfig("password"),
});
const author = await Cliffy.Input.prompt({
message: "Who are you? (optional) Name <email@example.com>",
default: getConfig("author"),
});
await setConfig("registry", registry);
await setConfig("username", username);
await setConfig("password", password);
await setConfig("author", author);
}