czon 0.8.2 → 0.8.3

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/dist/utils/git.js +13 -12
  2. package/package.json +1 -1
package/dist/utils/git.js CHANGED
@@ -15,21 +15,22 @@ exports.isUntracked = isUntracked;
15
15
  const child_process_1 = require("child_process");
16
16
  /**
17
17
  * Execute a git command and return the output
18
+ * Uses spawnSync to avoid shell parsing issues with special characters
18
19
  * @throws Error if the command fails
19
20
  */
20
21
  function execGit(args, options) {
21
- const command = ['git', ...args].join(' ');
22
- try {
23
- return (0, child_process_1.execSync)(command, {
24
- cwd: options?.cwd ?? process.cwd(),
25
- encoding: 'utf-8',
26
- stdio: ['pipe', 'pipe', 'pipe'],
27
- }).trim();
28
- }
29
- catch (error) {
30
- const err = error;
31
- throw new Error(err.stderr || err.message || 'Git command failed');
32
- }
22
+ const result = (0, child_process_1.spawnSync)('git', args, {
23
+ cwd: options?.cwd ?? process.cwd(),
24
+ encoding: 'utf-8',
25
+ stdio: ['pipe', 'pipe', 'pipe'],
26
+ });
27
+ if (result.error) {
28
+ throw result.error;
29
+ }
30
+ if (result.status !== 0) {
31
+ throw new Error(result.stderr || `git command failed with exit code ${result.status}`);
32
+ }
33
+ return (result.stdout || '').trim();
33
34
  }
34
35
  /**
35
36
  * Check if the current directory is a Git repository
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "czon",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "CZON - AI enhanced Markdown content engine",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",