Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions features/ticket_creation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,13 @@ Feature: Ticket Creation
When I run "ticket create 'First ticket'"
Then the command should succeed
And the tickets directory should exist

Scenario: Create ticket in dot-prefixed directory
Given I am in subdirectory ".nix"
When I run "ticket create 'Dot directory ticket'"
Then the command should succeed
And the output should match pattern "^[^.].*"
And a ticket file should exist with title "Dot directory ticket"
When I run "ticket list"
Then the command should succeed
And the output should contain "Dot directory ticket"
3 changes: 3 additions & 0 deletions ticket
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ generate_id() {
local dir_name
dir_name=$(basename "$(pwd)")

# Strip a leading dot from the repo name (for example, .nix) so generated ticket files are not hidden.
dir_name=$(echo "$dir_name" | sed 's/^\.*//')

# Extract first letter of each hyphenated/underscored segment
local prefix
prefix=$(echo "$dir_name" | sed 's/[-_]/ /g' | awk '{for(i=1;i<=NF;i++) printf substr($i,1,1)}')
Expand Down