easegit-cli 1.0.6 → 1.0.7

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.
@@ -51,16 +51,19 @@ const path = __importStar(require("path"));
51
51
  * Execute a Git command and return output
52
52
  */
53
53
  function gitExec(args, cwd) {
54
- try {
55
- return (0, child_process_1.execSync)(`git ${args.join(' ')}`, {
56
- cwd: cwd || process.cwd(),
57
- encoding: 'utf8',
58
- stdio: ['pipe', 'pipe', 'pipe']
59
- }).trim();
60
- }
61
- catch (error) {
62
- throw new Error(`Git command failed: ${error.message}`);
63
- }
54
+ const result = (0, child_process_1.spawnSync)('git', args, {
55
+ cwd: cwd || process.cwd(),
56
+ encoding: 'utf8',
57
+ stdio: ['pipe', 'pipe', 'pipe']
58
+ });
59
+ if (result.error) {
60
+ throw new Error(`Git command failed: ${result.error.message}`);
61
+ }
62
+ if (result.status !== 0) {
63
+ const stderr = result.stderr ? result.stderr.toString().trim() : '';
64
+ throw new Error(`Git command failed: ${stderr || 'Unknown error'}`);
65
+ }
66
+ return (result.stdout || '').toString().trim();
64
67
  }
65
68
  /**
66
69
  * Check if current directory is a Git repository
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easegit-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Automatic checkpoints before Git can hurt you",
5
5
  "main": "dist/index.js",
6
6
  "bin": {