Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions .gitgo
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
{
"current_issue": {
"number": "53",
"number": "",
"labels": [
"cli",
"enhancement"
""
],
"title": "Empty specific attributes from .gitgo before pushing it on github"
"title": ""
},
"commit_guidelines": [
"fix #"
"fix:",
" feat:",
" chore:"
],
"custom_guidelines": false,
"selected_commit_type": "♿ Improving accessibility",
"selected_commit_type": "",
"emojis": {
"initial_commit": "tada",
"feature": "sparkles",
Expand All @@ -30,14 +31,12 @@
"wip": "construction"
},
"existing_branches": [
"main",
"test-branch-gen",
"test-commit-gen"
""
],
"current_branch": [
"Empty-attributes-github"
""
],
"current_commit_message": "♿ fix #53 Empty specific attributes from .gitgo before pushing it on github",
"current_commit_message": "",
"use_emojis": true,
"commit_config": false
}
}
48 changes: 46 additions & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,52 @@ program
}),
"\n"
);
// asks task based questions
getConfigQuestions();
fs.stat("./.gitgo", function (err, stat) {
if (err == null) {
// asks task based questions
getConfigQuestions();
} else if (err.code === "ENOENT") {
// file does not exist
var conf = {
current_issue: {
number: "",
labels: [""],
title: "",
},
commit_guidelines: [""],
custom_guidelines: false,
selected_commit_type: "",
emojis: {
initial_commit: "tada",
feature: "sparkles",
ui: "art",
code_quality: "package",
performance: "racehorse",
security: "lock",
config: "wrench",
accessibility: "wheelchair",
dev_tools: "rocket",
docs: "pencil",
release: "gem",
bug_fix: "bug",
crash: "boom",
cleanup: "fire",
wip: "construction",
},
existing_branches: [],
current_branch: [""],
current_commit_message: "",
use_emojis: false,
commit_config: false,
};
fs.writeFile("./.gitgo", JSON.stringify(conf, null, 2), (err) => {
if (err) console.log("Error writing file:", err);
});
getConfigQuestions();
} else {
console.log("Some other error: ", err.code);
}
});
} else {
// checks if the directory is a git based repo or not
console.log(
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.