Merge pull request #1 from 5sw/workdir

Write generated file to current working directory
This commit is contained in:
Sven Weidauer 2020-12-30 14:56:38 +01:00 committed by GitHub
commit 45537b5314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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`)
}
}
}