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

fix: Create export folder if there's no tags #5

Merged
merged 2 commits into from
Nov 25, 2023
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
46 changes: 11 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,42 +45,18 @@ jobs:
skip-build-cache: true
skip-pkg-cache: true

tests-on-windows:
name: Run unit tests on windows
test:
name: Run unit tests
needs: golangci-lint
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Run unit tests
run: make.exe test-unit

tests-on-macos:
name: Run unit tests on macos
needs: golangci-lint
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Run unit tests
run: make test-unit

tests-on-unix:
name: Run unit tests on linux
needs: golangci-lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [
"macos-latest",
"ubuntu-latest",
"windows-latest"
]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ linters:
# Enable extra linters besides the default ones
enable:
- bodyclose
- depguard
- dogsled
- errcheck
- exhaustive
Expand Down
9 changes: 9 additions & 0 deletions utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,15 @@ func checkIfPathExistsAndRename(filepath string, extraPath string) string {
}

func createTagFolders(tags map[string]Tag) error {
if len(tags) == 0 {
err := createFolders(getExportedFilePath(nil, nil))
if err != nil {
return fmt.Errorf("%w \"%s\"", errCreatingFolder, exportDir)
}

return nil
}

for _, tag := range tags {
tag := tag
path := getExportedFilePath(tags, &tag)
Expand Down