diff --git a/.gitgo b/.gitgo index 8bd5c8f..5554cdd 100644 --- a/.gitgo +++ b/.gitgo @@ -1,17 +1,16 @@ { "current_issue": { - "number": "62", + "number": "", "labels": [ - "bug" + "" ], - "title": "Add (y/N) input checks" + "title": "" }, "commit_guidelines": [ - "cli: ", - " general: " + "fix #" ], - "custom_guidelines": true, - "selected_commit_type": "✨ Adding a new user-facing feature", + "custom_guidelines": false, + "selected_commit_type": "", "emojis": { "initial_commit": "tada", "feature": "sparkles", @@ -30,12 +29,12 @@ "wip": "construction" }, "existing_branches": [ - "main" + "" ], "current_branch": [ - "input-checks" + "" ], "current_commit_message": "", "use_emojis": true, - "commit_config": true + "commit_config": false } \ No newline at end of file diff --git a/README.md b/README.md index fcc2490..35be71a 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Before setting up the project, [download and install Node.js](https://nodejs.org After cloning the project, you need to execute the following commands to install and work on the project locally: ```bash -# This will install alll the needed dependencies +# This will install all the needed dependencies npm install # This will install the project from source locally in your system diff --git a/bin/index.js b/bin/index.js index bf7c355..d787836 100755 --- a/bin/index.js +++ b/bin/index.js @@ -303,7 +303,7 @@ program console.log(chalk.green("\ngtg display:\n")); console.log( `Use this to view the suggested branch name and commit title. You can also edit the suggested text based on your preference. This command should be run after ${chalk.yellow( - "gg start" + "gtg start" )}.\n` ); console.log(chalk.green("\ngtg checkout:\n")); diff --git a/lib/inquirer.js b/lib/inquirer.js index 7d64038..bae43c9 100644 --- a/lib/inquirer.js +++ b/lib/inquirer.js @@ -108,15 +108,11 @@ module.exports = { ]) .then((ans2) => { var emo = true; - if (ans2["emojis"] === "y" || ans2["emojis"] === "Y") { + if (ans2["emojis"] === "y" || "Y") { console.log( "\nWe have an awesome set of emojis in the .gitgo file which will be suggested to you in the commit messages.\n" ); - } else if ( - ans2["emojis"] === "n" || - ans2["emojis"] === "N" || - ans2["emojis"] === "" - ) { + } else if (ans2["emojis"] === "n" || "N" || "") { emo = false; } else { console.log( @@ -143,7 +139,7 @@ module.exports = { }); console.log( `\nSettings for your repo have been stored. Run ${chalk.yellow( - "gg start" + "gtg start" )} before working on an issue to get the branch name and commit title automatically. If you would like to change any settings manually, please edit the .gitgo file.\n` ); }); @@ -166,18 +162,25 @@ module.exports = { // expects issue number as response type: "string", message: - "Would you be using emojis in your commit messages?(y/n)", + "Would you be using emojis in your commit messages?(y/N)", name: "emojis", }, ]) .then((ans2) => { var emo = true; - if (ans2["emojis"] === "y") { + if (ans2["emojis"] === "y" || "Y") { console.log( "\nWe have an awesome set of emojis in the .gitgo file which will be suggested to you in the commit messages.\n" ); - } else { + } else if (ans2["emojis"] === "n" || "N" || "") { emo = false; + } else { + console.log( + `We don't know what you mean by "${ + ans2["emojis"] + }" ${emoji.get(":cry:")}` + ); + exit(); } reader.jsonReader("./.gitgo", (err, conf) => { if (err) { @@ -196,7 +199,7 @@ module.exports = { }); console.log( `\nSettings for your repo have been stored. Run ${chalk.yellow( - "gg start" + "gtg start" )} before working on an issue to get the branch name and commit title automatically. If you would like to change any settings manually, please edit the .gitgo file.\n` ); });