diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..be00eaa --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/Sources/LibMakeColors/MakeColors.swift b/Sources/LibMakeColors/MakeColors.swift index b125ec4..8dfa743 100644 --- a/Sources/LibMakeColors/MakeColors.swift +++ b/Sources/LibMakeColors/MakeColors.swift @@ -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`) } } }