diff --git a/beach-breach b/beach-breach new file mode 160000 index 0000000..c6259b1 --- /dev/null +++ b/beach-breach @@ -0,0 +1 @@ +Subproject commit c6259b13bb15f532775c8fe8d412719f3e518f78 diff --git a/src/actions/install-dependencies.js b/src/actions/install-dependencies.js index 0823ee5..7956988 100644 --- a/src/actions/install-dependencies.js +++ b/src/actions/install-dependencies.js @@ -1,6 +1,6 @@ import { confirm } from "@inquirer/prompts"; import { runCommand } from "../utils.js"; -import { log, warn } from "../console.js"; +import { printLine, warn } from "../console.js"; export default async function installDependencies(projectName) { const installDependencies = await confirm({ @@ -9,7 +9,7 @@ export default async function installDependencies(projectName) { if (installDependencies) { const installed = runCommand(`cd ${projectName} && npm i`); if (!installed) { - log("-".repeat(55)); + printLine(); warn("Unable to install dependencies."); } } diff --git a/src/console.js b/src/console.js index a633b09..e714963 100644 --- a/src/console.js +++ b/src/console.js @@ -28,3 +28,7 @@ export function textWhite(text) { export function textMagenta(text) { return customChalk.magenta(text); } + +export function printLine(symbol = "-") { + log(symbol.repeat(55)); +} diff --git a/src/flows/create-new-game.js b/src/flows/create-new-game.js index 85553a7..9be249e 100644 --- a/src/flows/create-new-game.js +++ b/src/flows/create-new-game.js @@ -4,7 +4,7 @@ import installDependencies from "../actions/install-dependencies.js"; import initRepo from "../actions/initialize-repository.js"; import cloneRepo from "../actions/clone-repo.js"; import { printSupport, slugify } from "../utils.js"; -import { log, success, textBlue, textGray } from "../console.js"; +import { log, printLine, success, textBlue, textGray } from "../console.js"; const TEMPLATES = [ { @@ -57,7 +57,7 @@ async function validateProjectName(name) { return true; } function outro(projectName, startCommand) { - log("-".repeat(55)); + printLine(); success("Project successfully configured."); log( `${textGray("Enter your directory:")} ${textBlue(`cd ./${projectName}`)}` diff --git a/src/flows/inspect-game.js b/src/flows/inspect-game.js index 3f4a7b1..0a4b69b 100644 --- a/src/flows/inspect-game.js +++ b/src/flows/inspect-game.js @@ -1,8 +1,7 @@ import { select } from "@inquirer/prompts"; -import { log, success, textGray, textBlue } from "../console.js"; +import { log, success, textGray, textBlue, printLine } from "../console.js"; import { printSupport, slugify } from "../utils.js"; import cloneRepo from "../actions/clone-repo.js"; -import installDependencies from "../actions/install-dependencies.js"; function byTitle(a, b) { if (a.title < b.title) { @@ -150,7 +149,7 @@ function getGames() { return indexed; } function outro(projectName) { - log("-".repeat(55)); + printLine(); success("Game successfully downloaded."); log( `${textGray("Enter the game directory:")} ${textBlue( diff --git a/src/utils.js b/src/utils.js index a3d51ba..24f5ce7 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,6 +1,7 @@ import { alert, log, + printLine, textBlue, textGray, textMagenta, @@ -21,7 +22,7 @@ export function printSupport() { log(textWhite("If you find yourself stuck:")); printDiscord(); printDocs(); - log("-".repeat(55)); + printLine(); } export function runCommand(command) {