gitbash 1.3.0 → 1.3.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 (2) hide show
  1. package/commands/create.sh +25 -23
  2. package/package.json +1 -1
@@ -172,40 +172,42 @@ TYPES
172
172
  fi
173
173
  else
174
174
  # Interactive mode
175
- echo "Enter Jira link (e.g., https://jira.company.com/browse/PROJ-123):"
175
+ echo "Enter Jira link (e.g., https://jira.company.com/browse/PROJ-123) or press Enter to skip:"
176
176
  prompt_read " > " jira_link
177
177
  fi
178
178
 
179
- if [[ -z "$jira_link" ]]; then
180
- echo "Error: No Jira link provided."
181
- return 1
182
- fi
183
-
184
179
  # -----------------------------
185
180
  # 2. Parse issue number from Jira link
186
181
  # -----------------------------
187
182
  local issue_number
188
- # First try to match just the issue number pattern (e.g., PROJ-123)
189
- issue_number=$(echo "$jira_link" | grep -o -E '^[A-Z]+-[0-9]+$' | head -1)
190
183
 
191
- # If not a direct match, try to extract from URL
192
- if [[ -z "$issue_number" ]]; then
193
- # Match patterns like PROJ-123, ABC-456, etc.
194
- # Supports both /browse/PROJ-123 and selectedIssue=PROJ-123 formats
195
- issue_number=$(echo "$jira_link" | grep -o -E '(browse/|selectedIssue=)[A-Z]+-[0-9]+' | grep -o '[A-Z]\+-[0-9]\+' | head -1)
196
- fi
197
-
198
- if [[ -z "$issue_number" ]]; then
199
- echo "Warning: Could not parse issue number from Jira link. Using NOISSUE."
184
+ if [[ -z "$jira_link" ]]; then
185
+ # No Jira link provided, use NOISSUE
200
186
  issue_number="NOISSUE"
201
- # If parsing failed and we had arguments, include the first arg in the title
202
- if [[ -n "$branch_title" ]]; then
203
- branch_title="$jira_link $branch_title"
187
+ print_info "No Jira link provided. Using NOISSUE."
188
+ else
189
+ # First try to match just the issue number pattern (e.g., PROJ-123)
190
+ issue_number=$(echo "$jira_link" | grep -o -E '^[A-Z]+-[0-9]+$' | head -1)
191
+
192
+ # If not a direct match, try to extract from URL
193
+ if [[ -z "$issue_number" ]]; then
194
+ # Match patterns like PROJ-123, ABC-456, etc.
195
+ # Supports both /browse/PROJ-123 and selectedIssue=PROJ-123 formats
196
+ issue_number=$(echo "$jira_link" | grep -o -E '(browse/|selectedIssue=)[A-Z]+-[0-9]+' | grep -o '[A-Z]\+-[0-9]\+' | head -1)
197
+ fi
198
+
199
+ if [[ -z "$issue_number" ]]; then
200
+ print_warning "Could not parse issue number from Jira link. Using NOISSUE."
201
+ issue_number="NOISSUE"
202
+ # If parsing failed and we had arguments, include the first arg in the title
203
+ if [[ -n "$branch_title" ]]; then
204
+ branch_title="$jira_link $branch_title"
205
+ else
206
+ branch_title="$jira_link"
207
+ fi
204
208
  else
205
- branch_title="$jira_link"
209
+ echo "Parsed issue number: $issue_number"
206
210
  fi
207
- else
208
- echo "Parsed issue number: $issue_number"
209
211
  fi
210
212
  echo
211
213
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitbash",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Opinionated git utilities for bash with fzf-powered menus",
5
5
  "author": "jaggli",
6
6
  "license": "MIT",