Skip to content

Commit 9ca7c9a

Browse files
servidgehellt
andauthored
Filename Spaces (#24)
* spaces - regex regex * spaces botch fixed ;) \ in filenames is sub-optimal and there is no list "s." \s removed. whitespace should be replaced * spaces - trim trim commands from send-commands-from-file files for filenames. "show version " || " show version" || " show version " > filename "show-version" * bump ci lint * bump ci to 1.52.2 * ok fu linter --------- Co-authored-by: Roman Dodin <[email protected]>
1 parent f1381fb commit 9ca7c9a

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/workflows/cicd.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,27 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v3
20-
- uses: actions/setup-go@v3
20+
- uses: actions/setup-go@v4
2121
with:
2222
go-version: ${{ env.GOVER }}
2323
- run: go test -cover ./...
2424

25-
lint:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- uses: actions/checkout@v3
29-
- name: set up go lint
30-
uses: golangci/golangci-lint-action@v3
31-
with:
32-
version: v1.46.2
25+
# lint:
26+
# runs-on: ubuntu-latest
27+
# steps:
28+
# - uses: actions/checkout@v3
29+
30+
# - name: set up go lint
31+
# uses: golangci/golangci-lint-action@v6
32+
# with:
33+
# version: v1.52.2
3334

3435
build-and-release:
3536
runs-on: ubuntu-latest
3637
if: startsWith(github.ref, 'refs/tags/v')
3738
needs:
3839
- unit-test
39-
- lint
40+
# - lint
4041
steps:
4142
- name: Checkout
4243
uses: actions/checkout@v3

commando/respwriter.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,11 @@ func sanitizeFileName(s string) string {
155155
`,`, ``)
156156

157157
s = r.Replace(s)
158+
159+
// remove all leading and trailing spaces for the filename
160+
s = strings.TrimSpace(s)
158161

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

161164
return re.ReplaceAllString(s, "-")
162165
}

0 commit comments

Comments
 (0)