generator-bitloops 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/setup/index.js +13 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-bitloops",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Next.js with TypeScript, Tailwind, Storybook and Cypress generator by Bitloops",
5
5
  "license": "MIT",
6
6
  "author": "Bitloops S.A.",
package/setup/index.js CHANGED
@@ -197,6 +197,18 @@ export default class extends Generator {
197
197
  );
198
198
  }
199
199
  }
200
+
201
+ this.commitChanges = async function() {
202
+ this.log('Committing changes to git...');
203
+ await new Promise((resolve) => {exec(`cd ${toKebabCase(this.options.project)} && git add . && git commit -m "Initial setup"`).on('exit', (code) => {
204
+ if (code !== 0) {
205
+ this.log('Error committing changes to git! ', code);
206
+ resolve();
207
+ }
208
+ this.log('Git changes committed!');
209
+ resolve();
210
+ });});
211
+ }
200
212
  }
201
213
 
202
214
  initializing() {
@@ -222,6 +234,7 @@ export default class extends Generator {
222
234
  this.installCypress();
223
235
  this.log('Patching files');
224
236
  await this.patchFiles();
237
+ await this.commitChanges();
225
238
  }
226
239
 
227
240
  end() {