Make it modern
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
import { Colors, Cliffy } from "../deps.ts";
|
||||
import { Colors, CliffyPrompt } from "../deps.ts";
|
||||
|
||||
import { getMeta, setMeta, log } from "../global.ts";
|
||||
|
||||
export default async function deprecate(options: any) {
|
||||
const meta = await getMeta();
|
||||
|
||||
const res = await Cliffy.Confirm.prompt(
|
||||
const res = await CliffyPrompt.Confirm.prompt(
|
||||
"Are you sure you want to deprecat this package?"
|
||||
);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Cliffy, Path, FS } from "../deps.ts";
|
||||
import { CliffyPrompt, Path, FS } from "../deps.ts";
|
||||
import {
|
||||
getMeta,
|
||||
setMeta,
|
||||
@ -11,7 +11,7 @@ export default async function init() {
|
||||
let existing = {};
|
||||
try {
|
||||
existing = await getMeta();
|
||||
} catch (err) {}
|
||||
} catch (err) { }
|
||||
let meta: IMeta = {
|
||||
name: Path.basename(Deno.cwd()).toLowerCase().replace(/\s+/g, "-"),
|
||||
version: "0.0.1",
|
||||
@ -23,21 +23,21 @@ export default async function init() {
|
||||
};
|
||||
|
||||
if (isInteractive()) {
|
||||
meta.name = await Cliffy.Input.prompt({
|
||||
meta.name = await CliffyPrompt.Input.prompt({
|
||||
message: "What's the name of your package?",
|
||||
default: meta.name,
|
||||
});
|
||||
meta.description = await Cliffy.Input.prompt({
|
||||
meta.description = await CliffyPrompt.Input.prompt({
|
||||
message: "What's the description of your package?",
|
||||
default: meta.description,
|
||||
});
|
||||
meta.author = await Cliffy.Input.prompt({
|
||||
meta.author = await CliffyPrompt.Input.prompt({
|
||||
message: "Who's the author of your package?",
|
||||
default: meta.author,
|
||||
});
|
||||
|
||||
if (!(await FS.exists("README.md"))) {
|
||||
const res = await Cliffy.Confirm.prompt({
|
||||
const res = await CliffyPrompt.Confirm.prompt({
|
||||
message: "Autogenerate README?",
|
||||
default: true,
|
||||
});
|
||||
|
@ -1,23 +1,23 @@
|
||||
import { Cliffy } from "../deps.ts";
|
||||
import { CliffyPrompt } from "../deps.ts";
|
||||
|
||||
import { getConfig, setConfig } from "../global.ts";
|
||||
|
||||
export default async function setup() {
|
||||
const registry = await Cliffy.Input.prompt({
|
||||
const registry = await CliffyPrompt.Input.prompt({
|
||||
message: "What's your registry?",
|
||||
default: getConfig("registry"),
|
||||
});
|
||||
const username = await Cliffy.Input.prompt({
|
||||
const username = await CliffyPrompt.Input.prompt({
|
||||
message: "What's your username?",
|
||||
default: getConfig("username"),
|
||||
});
|
||||
const password = await Cliffy.Secret.prompt({
|
||||
const password = await CliffyPrompt.Secret.prompt({
|
||||
message: "What's your password?",
|
||||
hidden: true,
|
||||
default: getConfig("password"),
|
||||
});
|
||||
|
||||
const author = await Cliffy.Input.prompt({
|
||||
const author = await CliffyPrompt.Input.prompt({
|
||||
message: "Who are you? (optional) Name <email@example.com>",
|
||||
default: getConfig("author"),
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Cliffy, Colors } from "../deps.ts";
|
||||
import { CliffyPrompt, Colors } from "../deps.ts";
|
||||
import { version } from "../version.ts";
|
||||
|
||||
export default async function upgrade() {
|
||||
@ -7,14 +7,14 @@ export default async function upgrade() {
|
||||
).then((e) => e.json());
|
||||
|
||||
if (meta.version === version) {
|
||||
const res = await Cliffy.Confirm.prompt({
|
||||
const res = await CliffyPrompt.Confirm.prompt({
|
||||
message: Colors.yellow("No update available!") + " Continue?",
|
||||
default: false,
|
||||
});
|
||||
if (!res) return;
|
||||
}
|
||||
|
||||
const res = await Cliffy.Confirm.prompt({
|
||||
const res = await CliffyPrompt.Confirm.prompt({
|
||||
message: "Are you sure you want to upgrade?",
|
||||
default: true,
|
||||
});
|
||||
|
Reference in New Issue
Block a user