From d3a1cf54e2f81ffd5f77250115df312ffddc02cb Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Wed, 30 Dec 2020 13:56:07 +0100 Subject: [PATCH] Write generated file to current working directory --- Sources/LibMakeColors/MakeColors.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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`) } } }