cc-discipline 2.9.0 → 2.9.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.
Files changed (3) hide show
  1. package/bin/cli.js +2 -0
  2. package/init.sh +13 -5
  3. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -131,9 +131,11 @@ Examples:
131
131
 
132
132
  // Run the bash script
133
133
  const unixScript = toUnixPath(script);
134
+ const pkgVersion = require(path.join(PKG_DIR, 'package.json')).version;
134
135
  const env = {
135
136
  ...process.env,
136
137
  CC_DISCIPLINE_PKG_DIR: process.platform === 'win32' ? toUnixPath(PKG_DIR) : PKG_DIR,
138
+ CC_DISCIPLINE_VERSION: pkgVersion,
137
139
  };
138
140
 
139
141
  const result = spawnSync(bash, [unixScript, ...scriptArgs], {
package/init.sh CHANGED
@@ -5,12 +5,20 @@
5
5
  # cd your-project && bash /path/to/init.sh --stack "3 4" --name myapp --global
6
6
  # Or: curl -sL https://raw.githubusercontent.com/YOU/cc-discipline/main/init.sh | bash
7
7
 
8
- set -e
8
+ # On Windows (Git Bash), set -e causes silent failures due to path/command differences.
9
+ # Use explicit error checking for critical operations instead.
10
+ if [[ "$(uname -s)" != MINGW* ]] && [[ "$(uname -s)" != MSYS* ]]; then
11
+ set -e
12
+ fi
9
13
 
10
- # ─── Version (single source: package.json) ───
11
- _INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
12
- if command -v node &>/dev/null && [ -f "$_INIT_DIR/package.json" ]; then
13
- VERSION=$(node -p "require('$_INIT_DIR/package.json').version" 2>/dev/null)
14
+ # ─── Version ───
15
+ # cli.js sets CC_DISCIPLINE_VERSION on Windows where node paths are tricky
16
+ VERSION="${CC_DISCIPLINE_VERSION:-unknown}"
17
+ if [ "$VERSION" = "unknown" ]; then
18
+ _INIT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
+ if command -v node &>/dev/null && [ -f "$_INIT_DIR/package.json" ]; then
20
+ VERSION=$(node -p "require('$_INIT_DIR/package.json').version" 2>/dev/null) || true
21
+ fi
14
22
  fi
15
23
  VERSION="${VERSION:-unknown}"
16
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-discipline",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "description": "Discipline framework for Claude Code — rules, hooks, and agents that keep AI on track",
5
5
  "bin": {
6
6
  "cc-discipline": "bin/cli.js"