Skip to content

Commit a672c66

Browse files
committed
feat: now it will remove last and first underscore.
new releaser added
1 parent 1a82ce4 commit a672c66

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

.air.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ testdata_dir = "testdata"
33
tmp_dir = "tmp"
44

55
[build]
6-
args_bin = ["--dir=assets/svg", "--prefix=SVG"]
6+
args_bin = ["--dir=assets/svg", "--prefix=SVG_"]
77
bin = "./tmp/main"
88
cmd = "go build -o ./tmp/main ."
99
delay = 1000

.github/workflows/go.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# This workflow will build a golang project
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
1+
# # This workflow will build a golang project
2+
# # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
33

4-
name: Go
4+
# name: Go
55

6-
on:
7-
push:
8-
branches: [ "main" ]
9-
pull_request:
10-
branches: [ "main" ]
6+
# on:
7+
# push:
8+
# branches: [ "main" ]
9+
# pull_request:
10+
# branches: [ "main" ]
1111

12-
jobs:
12+
# jobs:
1313

14-
build:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- uses: actions/checkout@v4
14+
# build:
15+
# runs-on: ubuntu-latest
16+
# steps:
17+
# - uses: actions/checkout@v4
1818

19-
- name: Set up Go
20-
uses: actions/setup-go@v4
21-
with:
22-
go-version: '1.24.4'
19+
# - name: Set up Go
20+
# uses: actions/setup-go@v4
21+
# with:
22+
# go-version: '1.24.4'
2323

24-
- name: Build
25-
run: go build -v ./...
24+
# - name: Build
25+
# run: go build -v ./...

assets/svg/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
export { default as SVG_GOLANG_1_ } from "./!golang-(((1))).svg?no-inline";
1+
export { default as SVG_GOLANG_1 } from "./!golang-(((1))).svg?no-inline";
22
export { default as SVG_RUST_LOGO } from "./!rust-logo.svg?no-inline";
3-
export { default as SVGHEADER_BLURRY_COLOR_EFFECT_MIN } from "./header-blurry-color-effect-min.png";
4-
export { default as SVGHEADER_BLURRY_COLOR_EFFECT } from "./header-blurry-color-effect.png";
5-
export { default as SVGJAVASCRIPT_LOGO } from "./javascript-logo.svg";
6-
export { default as SVGPKG_CARD_CORNER_BLOB } from "./pkg-card-corner-blob.png";
7-
export { default as SVGTRUST_PILOT_STARS_AND_LOGO } from "./trust-pilot-stars-and-logo.png";
3+
export { default as SVG_HEADER_BLURRY_COLOR_EFFECT_MIN } from "./header-blurry-color-effect-min.png";
4+
export { default as SVG_HEADER_BLURRY_COLOR_EFFECT } from "./header-blurry-color-effect.png";
5+
export { default as SVG_JAVASCRIPT_LOGO } from "./javascript-logo.svg";
6+
export { default as SVG_PKG_CARD_CORNER_BLOB } from "./pkg-card-corner-blob.png";
7+
export { default as SVG_TRUST_PILOT_STARS_AND_LOGO } from "./trust-pilot-stars-and-logo.png";

internal/generator/main.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ func GenerateAsset(directoryPath string) {
8686

8787
//Normalizing Name for JS variable
8888
normalizeNameRegex := regexp.MustCompile(`[-. !)(]`)
89-
underscorredFileNamd := normalizeNameRegex.ReplaceAllString(fileNameWithoutExtension, "_")
89+
underscorredFileName := normalizeNameRegex.ReplaceAllString(fileNameWithoutExtension, "_")
90+
91+
// remove starting and trailing underscores
92+
underscorredFileName = strings.Trim(underscorredFileName, "_")
9093

9194
// remove morethan two underscore
9295
removedMoreUnderscoreRegex := regexp.MustCompile(`_{2,}`)
93-
normalizedFileName := removedMoreUnderscoreRegex.ReplaceAllString(underscorredFileNamd, "_")
96+
normalizedFileName := removedMoreUnderscoreRegex.ReplaceAllString(underscorredFileName, "_")
9497

9598
if isValidFiles(name) {
9699

0 commit comments

Comments
 (0)