Skip to content

Commit 6536bca

Browse files
committed
Improve install command appearance
1 parent 7535fab commit 6536bca

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/extension/install.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export async function installExtension(
4444
// Not trusted, cancel
4545
cancelInstallation();
4646
} else {
47+
info("");
48+
4749
// Compute the installation directory
4850
const currentDir = Deno.cwd();
4951
const installDir = await determineInstallDir(currentDir, allowPrompt);
@@ -89,8 +91,10 @@ async function isTrusted(
8991

9092
// Ask for trust
9193
const question = "Do you trust the authors of this extension";
92-
const confirmed: boolean = await Confirm.prompt(question);
93-
94+
const confirmed: boolean = await Confirm.prompt({
95+
message: question,
96+
default: true,
97+
});
9498
return confirmed;
9599
} else {
96100
return true;
@@ -396,18 +400,19 @@ async function confirmInstallation(
396400

397401
if (extensionRows.length > 0) {
398402
const table = new Table(...extensionRows);
399-
info(`\nThe following changes will be made:\n${table.toString()}\n\n`);
403+
info(`\nThe following changes will be made:\n${table.toString()}\n`);
400404
const question = "Would you like to continue";
401-
return !allowPrompt || await Confirm.prompt(question);
405+
return !allowPrompt ||
406+
await Confirm.prompt({ message: question, default: true });
402407
} else {
403-
info(`\nNo changes required - extensions already installed.\n\n`);
408+
info(`\nNo changes required - extensions already installed.\n`);
404409
return true;
405410
}
406411
}
407412

408413
// Copy the extension files into place
409414
async function completeInstallation(downloadDir: string, installDir: string) {
410-
info("\n");
415+
info("");
411416
await withSpinner({
412417
message: `Copying`,
413418
doneMessage: `Extension installation complete`,

0 commit comments

Comments
 (0)