@lenne.tech/cli 1.51.0 → 1.51.1

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.
@@ -189,12 +189,20 @@ class Git {
189
189
  });
190
190
  }
191
191
  /**
192
- * Get default branch
192
+ * Get the default branch (where `origin/HEAD` points), or `''` when it is not set, so the
193
+ * callers' fallback (`|| 'main'`) applies instead of an exception.
193
194
  */
194
195
  getDefaultBranch() {
195
- // Toolbox features
196
- const { system: { run }, } = this.toolbox;
197
- return run('basename $(git symbolic-ref --short refs/remotes/origin/HEAD)');
196
+ return __awaiter(this, void 0, void 0, function* () {
197
+ // No shell: `basename $(…)` is POSIX syntax, so `lt git get` failed under cmd.exe on Windows.
198
+ try {
199
+ const ref = yield (0, exec_args_1.execArgs)('git', ['symbolic-ref', '--short', 'refs/remotes/origin/HEAD'], { trim: true });
200
+ return ref.slice(ref.lastIndexOf('/') + 1);
201
+ }
202
+ catch (_a) {
203
+ return '';
204
+ }
205
+ });
198
206
  }
199
207
  /**
200
208
  * Get git user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/cli",
3
- "version": "1.51.0",
3
+ "version": "1.51.1",
4
4
  "description": "lenne.Tech CLI: lt",
5
5
  "keywords": [
6
6
  "lenne.Tech",