@rui.branco/claude-commands-mcp 2.0.28 → 2.0.29

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/index.js +10 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -113,14 +113,8 @@ function gitPushSync() {
113
113
  }
114
114
 
115
115
  function gitPush(message) {
116
- if (needsRecovery()) gitRecover();
117
- execSync("git add -A", { cwd: CACHE_DIR, stdio: "pipe" });
118
- try {
119
- execSync(`git commit -m "${message}"`, { cwd: CACHE_DIR, stdio: "pipe" });
120
- } catch {
121
- return;
122
- }
123
- // Push in background — don't block the caller
116
+ // Everything runs in background — don't block the caller
117
+ const escapedMessage = message.replace(/"/g, '\\"');
124
118
  const child = spawn(
125
119
  "node",
126
120
  [
@@ -128,6 +122,14 @@ function gitPush(message) {
128
122
  `
129
123
  const { execSync } = require("child_process");
130
124
  const cwd = ${JSON.stringify(CACHE_DIR)};
125
+ try { const s = execSync("git status --porcelain -b", { cwd, stdio: "pipe" }).toString();
126
+ if (s.includes("no branch") || s.includes("rebase")) {
127
+ try { execSync("git rebase --abort", { cwd, stdio: "pipe" }); } catch {}
128
+ try { execSync("git checkout main", { cwd, stdio: "pipe" }); } catch {}
129
+ }
130
+ } catch {}
131
+ execSync("git add -A", { cwd, stdio: "pipe" });
132
+ try { execSync('git commit -m "${escapedMessage}"', { cwd, stdio: "pipe" }); } catch { process.exit(0); }
131
133
  for (let i = 0; i < 3; i++) {
132
134
  try { execSync("git push", { cwd, stdio: "pipe" }); process.exit(0); } catch {}
133
135
  try { execSync("git pull --rebase", { cwd, stdio: "pipe" }); } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rui.branco/claude-commands-mcp",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "MCP server that serves Claude Code skill definitions from a git repo",
5
5
  "type": "module",
6
6
  "main": "index.js",