We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c35a1c8 commit 4408b6fCopy full SHA for 4408b6f
Sources/ScriptToolkit/FileExtension.swift
@@ -11,6 +11,15 @@ import SwiftShell
11
12
public extension File {
13
14
+ public func nameWithSuffix(_ suffix: String) -> String {
15
+ if let unwrappedExtension = `extension` {
16
+ return nameExcludingExtension + suffix + "." + unwrappedExtension
17
+ }
18
+ else {
19
+ return nameExcludingExtension + suffix
20
21
22
+
23
////////////////////////////////////////////////////////////////////////////////
24
// MARK: - Duplication
25
0 commit comments