ccman 0.1.0 → 0.1.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccman",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Claude Code Manager - A TypeScript tool to manage Claude Code API configurations",
5
5
  "main": "dist/index.js",
6
6
  "packageManager": "pnpm@8.15.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccman",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Claude Code Manager - A TypeScript tool to manage Claude Code API configurations",
5
5
  "main": "dist/index.js",
6
6
  "packageManager": "pnpm@8.15.1",
@@ -148,11 +148,11 @@ push_to_remote_quiet() {
148
148
  # 推送提交(如果有)
149
149
  if [ "$has_commit" = "true" ]; then
150
150
  local current_branch=$(git branch --show-current)
151
- git push origin "$current_branch" 2>/dev/null
151
+ git push origin "$current_branch" >/dev/null 2>&1
152
152
  fi
153
153
 
154
154
  # 推送tag
155
- git push origin "$tag_name" 2>/dev/null || git push origin "$tag_name" --force 2>/dev/null
155
+ git push origin "$tag_name" >/dev/null 2>&1 || git push origin "$tag_name" --force >/dev/null 2>&1
156
156
  }
157
157
 
158
158
  # 推送tag和提交到远程(交互模式)
@@ -185,8 +185,8 @@ create_tag_quietly() {
185
185
  # 检查tag是否已存在
186
186
  if check_tag_exists "$tag_name"; then
187
187
  # 如果tag存在,删除并重新创建
188
- git tag -d "$tag_name" 2>/dev/null
189
- git push origin --delete "$tag_name" 2>/dev/null
188
+ git tag -d "$tag_name" >/dev/null 2>&1
189
+ git push origin --delete "$tag_name" >/dev/null 2>&1
190
190
  fi
191
191
 
192
192
  # 创建tag
@@ -199,10 +199,10 @@ create_tag_quietly() {
199
199
 
200
200
  Co-Authored-By: Claude <noreply@anthropic.com>"
201
201
 
202
- git tag -a "$tag_name" -m "$tag_message" 2>/dev/null
202
+ git tag -a "$tag_name" -m "$tag_message" >/dev/null 2>&1
203
203
 
204
- # 静默推送
205
- push_to_remote_quiet "$tag_name" "false"
204
+ # 静默推送(始终推送当前分支和tag)
205
+ push_to_remote_quiet "$tag_name" "true"
206
206
 
207
207
  # 输出tag名称
208
208
  echo "$tag_name"
@@ -37,8 +37,10 @@ get_current_version() {
37
37
  calculate_version_preview() {
38
38
  local version_type=$1
39
39
  local preview=$(pnpm version $version_type --dry-run 2>/dev/null)
40
- if [ $? -eq 0 ] && [ -n "$preview" ]; then
41
- echo "$preview" | sed 's/^v//' 2>/dev/null || echo "计算失败"
40
+
41
+ if [ -n "$preview" ]; then
42
+ # 移除前缀v并返回
43
+ echo "$preview" | sed 's/^v//'
42
44
  else
43
45
  echo "计算失败"
44
46
  fi
@@ -94,23 +96,18 @@ version_bump() {
94
96
  show_version_menu "$current_version" "$suggested_type"
95
97
 
96
98
  # 获取用户选择
97
- read -p "请选择版本升级类型 (1-5, 回车默认选择推荐): " choice
99
+ read -p "请选择版本升级类型 (1-4, 回车默认选择推荐): " choice
98
100
 
99
101
  # 处理用户选择
100
102
  case ${choice:-""} in
101
- 1|"")
102
- if [ "$suggested_type" == "patch" ]; then
103
- version_type="patch"
104
- elif [ "$suggested_type" == "minor" ]; then
105
- version_type="minor"
106
- else
107
- version_type="major"
108
- fi
103
+ "")
104
+ # 回车默认选择推荐版本
105
+ version_type="$suggested_type"
109
106
  ;;
110
- 2) version_type="patch" ;;
111
- 3) version_type="minor" ;;
112
- 4) version_type="major" ;;
113
- 5) handle_custom_version ;;
107
+ 1) version_type="patch" ;;
108
+ 2) version_type="minor" ;;
109
+ 3) version_type="major" ;;
110
+ 4) handle_custom_version ;;
114
111
  *)
115
112
  print_error "无效选择"
116
113
  exit 1