@kaitranntt/ccs 2.4.7 → 2.4.9

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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.4.7
1
+ 2.4.9
package/bin/ccs.js CHANGED
@@ -11,13 +11,34 @@ const { getSettingsPath, getConfigPath } = require('./config-manager');
11
11
  // Version (sync with package.json)
12
12
  const CCS_VERSION = require('../package.json').version;
13
13
 
14
+ // Helper: Escape arguments for shell execution
15
+ function escapeShellArg(arg) {
16
+ // Windows: escape double quotes and wrap in double quotes
17
+ return '"' + String(arg).replace(/"/g, '""') + '"';
18
+ }
19
+
14
20
  // Execute Claude CLI with unified spawn logic
15
21
  function execClaude(claudeCli, args) {
16
- const child = spawn(claudeCli, args, {
17
- stdio: 'inherit',
18
- windowsHide: true,
19
- shell: true // FIX: Enable shell for .cmd/.bat files on Windows
20
- });
22
+ const isWindows = process.platform === 'win32';
23
+ const needsShell = isWindows && /\.(cmd|bat|ps1)$/i.test(claudeCli);
24
+
25
+ let child;
26
+ if (needsShell) {
27
+ // When shell needed: concatenate into string to avoid DEP0190 warning
28
+ const cmdString = [claudeCli, ...args].map(escapeShellArg).join(' ');
29
+ child = spawn(cmdString, {
30
+ stdio: 'inherit',
31
+ windowsHide: true,
32
+ shell: true
33
+ });
34
+ } else {
35
+ // When no shell needed: use array form (faster, no shell overhead)
36
+ child = spawn(claudeCli, args, {
37
+ stdio: 'inherit',
38
+ windowsHide: true
39
+ });
40
+ }
41
+
21
42
  child.on('exit', (code, signal) => {
22
43
  if (signal) process.kill(process.pid, signal);
23
44
  else process.exit(code || 0);
package/lib/ccs CHANGED
@@ -2,7 +2,7 @@
2
2
  set -euo pipefail
3
3
 
4
4
  # Version (updated by scripts/bump-version.sh)
5
- CCS_VERSION="2.4.7"
5
+ CCS_VERSION="2.4.9"
6
6
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
7
  readonly CONFIG_FILE="${CCS_CONFIG:-$HOME/.ccs/config.json}"
8
8
 
package/lib/ccs.ps1 CHANGED
@@ -134,7 +134,7 @@ function Show-Help {
134
134
  }
135
135
 
136
136
  # Version (updated by scripts/bump-version.sh)
137
- $CcsVersion = "2.4.7"
137
+ $CcsVersion = "2.4.9"
138
138
  $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
139
139
  $ConfigFile = if ($env:CCS_CONFIG) { $env:CCS_CONFIG } else { "$env:USERPROFILE\.ccs\config.json" }
140
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaitranntt/ccs",
3
- "version": "2.4.7",
3
+ "version": "2.4.9",
4
4
  "description": "Claude Code Switch - Instant profile switching between Claude Sonnet 4.5 and GLM 4.6",
5
5
  "keywords": [
6
6
  "cli",