@snapcommit/cli 1.1.1 → 1.1.2

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.
@@ -98,7 +98,7 @@ async function naturalCommand(userInput) {
98
98
  const authConfig = await (0, auth_1.ensureAuth)();
99
99
  if (!authConfig) {
100
100
  console.log(chalk_1.default.red('\n❌ Authentication required to use SnapCommit\n'));
101
- process.exit(1);
101
+ return;
102
102
  }
103
103
  // Check if in git repo
104
104
  if (!(0, git_1.isGitRepo)()) {
@@ -52,25 +52,25 @@ async function quickCommand() {
52
52
  const authConfig = await (0, auth_1.ensureAuth)();
53
53
  if (!authConfig) {
54
54
  console.log(chalk_1.default.red('\n❌ Authentication required to use SnapCommit\n'));
55
- process.exit(1);
55
+ return;
56
56
  }
57
57
  const token = (0, auth_1.getToken)();
58
58
  if (!token) {
59
59
  console.log(chalk_1.default.red('\n❌ No authentication token found\n'));
60
- process.exit(1);
60
+ return;
61
61
  }
62
62
  // Check git repo
63
63
  if (!(0, git_1.isGitRepo)()) {
64
- console.log(chalk_1.default.red('❌ Not a git repository'));
65
- process.exit(1);
64
+ console.log(chalk_1.default.red('❌ Not a git repository\n'));
65
+ return;
66
66
  }
67
67
  // Stage all changes
68
68
  try {
69
69
  (0, git_1.stageAllChanges)();
70
70
  }
71
71
  catch (error) {
72
- console.log(chalk_1.default.red('❌ Failed to stage changes'));
73
- process.exit(1);
72
+ console.log(chalk_1.default.red('❌ Failed to stage changes\n'));
73
+ return;
74
74
  }
75
75
  // Get diff
76
76
  let diff;
@@ -78,12 +78,12 @@ async function quickCommand() {
78
78
  diff = (0, git_1.getGitDiff)(true);
79
79
  }
80
80
  catch (error) {
81
- console.log(chalk_1.default.red('❌ Failed to get diff'));
82
- process.exit(1);
81
+ console.log(chalk_1.default.red('❌ Failed to get diff\n'));
82
+ return;
83
83
  }
84
84
  if (!diff.trim()) {
85
- console.log(chalk_1.default.yellow('⚠️ No changes to commit'));
86
- process.exit(0);
85
+ console.log(chalk_1.default.yellow('⚠️ No changes to commit\n'));
86
+ return;
87
87
  }
88
88
  // Truncate large diffs
89
89
  if (diff.length > 40000) {
@@ -103,7 +103,7 @@ async function quickCommand() {
103
103
  process.stdout.write(chalk_1.default.red('✗\n'));
104
104
  (0, analytics_1.trackEvent)({ event: 'commit_error' });
105
105
  console.log(chalk_1.default.red(`❌ ${error.message}\n`));
106
- process.exit(1);
106
+ return;
107
107
  }
108
108
  // Show message
109
109
  console.log(chalk_1.default.white(`📝 ${chalk_1.default.bold(message.split('\n')[0])}`));
@@ -126,6 +126,6 @@ async function quickCommand() {
126
126
  }
127
127
  catch (error) {
128
128
  console.log(chalk_1.default.red('\n❌ Commit failed\n'));
129
- process.exit(1);
129
+ return;
130
130
  }
131
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcommit/cli",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Instant AI commits. Beautiful progress tracking. Never write commit messages again.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {