@@ -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