Write generated file to current working directory #1

Merged
Sven merged 7 commits from workdir into main 2020-12-30 13:56:39 +00:00
2 changed files with 27 additions and 1 deletions

25
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Build and run tests
on:
pull_request:
jobs:
BuildAndTest:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Cache Swift packages
uses: actions/cache@v2
with:
path: |
.build/checkouts
.build/repositories
.build/workspace-state.json
key: ${{ runner.os }}-${{ hashFiles('Package.resolved') }}
- name: Build
run: swift build
- name: Run tests
run: swift test

View file

@ -76,7 +76,8 @@ public final class MakeColors: ParsableCommand, Context {
if let output = output {
return URL(fileURLWithPath: output)
} else {
return URL(fileURLWithPath: input).deletingPathExtension().appendingPathExtension(`extension`)
let basename = URL(fileURLWithPath: input).deletingPathExtension().lastPathComponent
return URL(fileURLWithPath: basename).appendingPathExtension(`extension`)
}
}
}