Skip to content

Commit 89db0fc

Browse files
🐛 Fix(index.ts,defaultConfig): wrong commit return value and defaultConfig SCOPES options (website has same value as api)
2 parents 5a1f911 + 18368ec commit 89db0fc

4 files changed

Lines changed: 18 additions & 102 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# commitsmile
22

3+
## 0.3.10
4+
5+
### Patch Changes
6+
7+
- fix commit message bug + scopes bug (same value website and api)
8+
39
## 0.3.9
410

511
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commitsmile",
3-
"version": "0.3.9",
3+
"version": "0.3.10",
44
"description": "Make smile on your commits",
55
"keywords": [],
66
"homepage": "",

src/defaultConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const defaultConfig: z.infer<typeof configSchema> = {
6565
options: [
6666
{ label: "🌍 Enviroment", value: "enviroment" },
6767
{ label: "📖 Docs", value: "docs" },
68-
{ label: "🌐 Website", value: "api" },
68+
{ label: "🌐 Website", value: "web" },
6969
{ label: "📱 Mobile", value: "mobile" },
7070
{ label: "🍃 API", value: "api" }
7171
]

src/index.ts

Lines changed: 10 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -23,36 +23,7 @@ program
2323
logging.debug("Options: ", options);
2424

2525
const config = await getConfiguration(options.config);
26-
// const Answers = await prompter.group(
27-
// {
28-
// changes: async () => await select(config.CHANGES),
29-
// scopes: async () => await select(config.SCOPES),
30-
// commitShort: async () => await prompter.text(config.COMMIT_SHORT),
31-
// commitDescription: async () => await prompter.text(config.COMMIT_DESCRIPTION),
32-
// commit: async ({ results }) => {
33-
// const { changes, scopes, commitShort } = results;
34-
// const commit = (): string => {
35-
// const scopesFormat = scopes ? `(${scopes})` : "";
36-
// return `${changes}${scopesFormat}: ${commitShort}`;
37-
// };
38-
// prompter.note(commit());
39-
// let agree = await prompter.confirm({ message: "Commit message is correct?" });
40-
// if (prompter.isCancel(agree) || !agree) {
41-
// prompter.cancel("Commit message is canceled!");
42-
// process.exit(0);
43-
// }
44-
// return commit;
45-
// }
46-
// },
47-
// {
48-
// onCancel: () => {
49-
// prompter.cancel("Operation cancelled.");
50-
// process.exit(0);
51-
// }
52-
// }
53-
// );
54-
// console.log(Answers.commit);
55-
const group = await prompter.group(
26+
const Answers = await prompter.group(
5627
{
5728
changes: async () => select(config.CHANGES),
5829
scopes: async () => select(config.SCOPES),
@@ -74,84 +45,23 @@ program
7445
}
7546
},
7647
{
77-
// On Cancel callback that wraps the group
78-
// So if the user cancels one of the prompts in the group this function will be called
79-
onCancel: ({ results }) => {
48+
onCancel: () => {
8049
prompter.cancel("Operation cancelled.");
8150
process.exit(0);
8251
}
8352
}
8453
);
85-
86-
console.log(group.changes, group.scopes, group.commitShort, group.commitDescription, group.commit);
87-
console.log(`git commit -m "${group.commit}" ${group.commitDescription ? `-m "${group.commitDescription}"` : ""}`);
88-
89-
// logging.info(
90-
// `git commit -m "${Answers.commit}" ${Answers.commitDescription ? `-m "${Answers.commitDescription}"` : ""}`
91-
// );
92-
// spawnSync(
93-
// `git commit -m "${Answers.commit}" ${Answers.commitDescription ? `-m "${Answers.commitDescription}"` : ""}`,
94-
// {
95-
// shell: true,
96-
// stdio: "inherit"
97-
// }
98-
// );
54+
logging.debug(Answers.commit);
55+
spawnSync(
56+
`git commit -m "${Answers.commit}" ${Answers.commitDescription ? `-m "${Answers.commitDescription}"` : ""}`,
57+
{
58+
shell: true,
59+
stdio: "inherit"
60+
}
61+
);
9962

10063
return process.exit(0);
10164
});
102-
// program
103-
// .description("Execute Commit Smile application")
104-
// .option("-C, --config <relativePath>", "path to config", EXECUTED_PATH)
105-
// .option("-D, --debugger", "Debugger mode", false)
106-
// .action(async (options: { debugger: boolean; config: string }) => {
107-
// process.env.DEBUG = options.debugger ? "TRUE" : "FALSE";
108-
109-
// logging.debug("Debug mode enabled");
110-
// logging.debug("Options: ", options);
111-
112-
// const config = await getConfiguration(options.config);
113-
// const Answers = await prompter.group(
114-
// {
115-
// changes: async () => await select(config.CHANGES),
116-
// scopes: async () => await select(config.SCOPES),
117-
// commitShort: async () => await prompter.text(config.COMMIT_SHORT),
118-
// commitDescription: async () => await prompter.text(config.COMMIT_DESCRIPTION),
119-
// commit: async ({ results }) => {
120-
// const { changes, scopes, commitShort } = results;
121-
// const commit = (): string => {
122-
// const scopesFormat = scopes ? `(${scopes})` : "";
123-
// return `${changes}${scopesFormat}: ${commitShort}`;
124-
// };
125-
// prompter.note(commit());
126-
// let agree = await prompter.confirm({ message: "Commit message is correct?" });
127-
// if (prompter.isCancel(agree) || !agree) {
128-
// prompter.cancel("Commit message is canceled!");
129-
// process.exit(0);
130-
// }
131-
// return commit;
132-
// }
133-
// },
134-
// {
135-
// onCancel: () => {
136-
// prompter.cancel("Operation cancelled.");
137-
// process.exit(0);
138-
// }
139-
// }
140-
// );
141-
// console.log(Answers.commit);
142-
// // logging.info(
143-
// // `git commit -m "${Answers.commit}" ${Answers.commitDescription ? `-m "${Answers.commitDescription}"` : ""}`
144-
// // );
145-
// // spawnSync(
146-
// // `git commit -m "${Answers.commit}" ${Answers.commitDescription ? `-m "${Answers.commitDescription}"` : ""}`,
147-
// // {
148-
// // shell: true,
149-
// // stdio: "inherit"
150-
// // }
151-
// // );
152-
153-
// return process.exit(0);
154-
// });
15565

15666
// program
15767
// .command("init")

0 commit comments

Comments
 (0)