Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filename Spaces #24

Merged
merged 6 commits into from
Sep 24, 2024
Merged
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
21 changes: 11 additions & 10 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GOVER }}
- run: go test -cover ./...

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set up go lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.46.2
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3

# - name: set up go lint
# uses: golangci/golangci-lint-action@v6
# with:
# version: v1.52.2

build-and-release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- unit-test
- lint
# - lint
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
5 changes: 4 additions & 1 deletion commando/respwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,11 @@ func sanitizeFileName(s string) string {
`,`, ``)

s = r.Replace(s)

// remove all leading and trailing spaces for the filename
s = strings.TrimSpace(s)

re := regexp.MustCompile(`[^0-9A-Za-z\s.\_\-]+`)
re := regexp.MustCompile(`[^0-9A-Za-z.\_\-]+`)

return re.ReplaceAllString(s, "-")
}
Loading