From 536c45a859c93dda90a2ec4ef9e3cd377934c1fd Mon Sep 17 00:00:00 2001 From: eccenux Date: Thu, 13 Jul 2023 22:34:11 +0200 Subject: [PATCH] v0.2 tweaks * Init with "main" branch --- src/GitOps.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GitOps.js b/src/GitOps.js index 87d3691..befae4e 100644 --- a/src/GitOps.js +++ b/src/GitOps.js @@ -17,6 +17,8 @@ export default class GitOps { this.repoName = repoName; /** Fake domain for e-mails. */ this.fakeDomain = 'fake.wikipedia.org'; + /** Default branch. */ + this.branch = 'main'; } set baseDir(dir) { @@ -41,7 +43,7 @@ export default class GitOps { /** Create repo. */ async create() { - const result = await this.exec(`git init ${this.repoName}`, this.baseDir); + const result = await this.exec(`git init ${this.repoName} -b ${this.branch}`, this.baseDir); if (!result) { throw 'Unable to create repo!'; }