chore: standardize ESLint/Prettier formatting across codebase
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const os = require("node:os");
|
||||
const path = require("node:path");
|
||||
const readline = require("node:readline");
|
||||
const process = require("node:process");
|
||||
const os = require('node:os');
|
||||
const path = require('node:path');
|
||||
const readline = require('node:readline');
|
||||
const process = require('node:process');
|
||||
|
||||
function expandHome(p) {
|
||||
if (!p) return p;
|
||||
if (p.startsWith("~")) return path.join(os.homedir(), p.slice(1));
|
||||
if (p.startsWith('~')) return path.join(os.homedir(), p.slice(1));
|
||||
return p;
|
||||
}
|
||||
|
||||
@@ -27,16 +27,16 @@ function promptQuestion(question) {
|
||||
}
|
||||
|
||||
async function promptYesNo(question, defaultYes = true) {
|
||||
const suffix = defaultYes ? " [Y/n] " : " [y/N] ";
|
||||
const suffix = defaultYes ? ' [Y/n] ' : ' [y/N] ';
|
||||
const ans = (await promptQuestion(`${question}${suffix}`)).trim().toLowerCase();
|
||||
if (!ans) return defaultYes;
|
||||
if (["y", "yes"].includes(ans)) return true;
|
||||
if (["n", "no"].includes(ans)) return false;
|
||||
if (['y', 'yes'].includes(ans)) return true;
|
||||
if (['n', 'no'].includes(ans)) return false;
|
||||
return promptYesNo(question, defaultYes);
|
||||
}
|
||||
|
||||
async function promptPath(question, defaultValue) {
|
||||
const prompt = `${question}${defaultValue ? ` (default: ${defaultValue})` : ""}: `;
|
||||
const prompt = `${question}${defaultValue ? ` (default: ${defaultValue})` : ''}: `;
|
||||
const ans = (await promptQuestion(prompt)).trim();
|
||||
return expandHome(ans || defaultValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user