QOL improvements or CLI
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Fabian Stamm
2020-07-31 19:45:14 +02:00
parent ebc6c83f29
commit 0bee324519
6 changed files with 43 additions and 234 deletions

View File

@ -1,4 +1,4 @@
import { Cliffy, Path, FS, Compress, Base64 } from "../deps.ts";
import { Cliffy, Path, FS } from "../deps.ts";
import {
getMeta,
setMeta,
@ -18,7 +18,7 @@ export default async function init() {
description: "",
author: getConfig("author"),
contributors: [],
files: ["**/*.ts", "**/*.js"],
files: ["**/*.ts", "**/*.js", "README.md"],
...existing,
};
@ -35,6 +35,19 @@ export default async function init() {
message: "Who's the author of your package?",
default: meta.author,
});
if (!(await FS.exists("README.md"))) {
const res = await Cliffy.Confirm.prompt({
message: "Autogenerate README?",
default: true,
});
if (res) {
await Deno.writeFile(
"README.md",
new TextEncoder().encode(meta.description || "")
);
}
}
}
await setMeta(meta);