Skip to content

Commit 8f6e489

Browse files
committed
[fix]: compilation fix
1 parent 19b8e55 commit 8f6e489

File tree

6 files changed

+56
-6
lines changed

6 files changed

+56
-6
lines changed

Package.resolved

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ let package = Package(
1212
targets: ["ScriptToolkit"]),
1313
],
1414
dependencies: [
15-
.package(url: "https://github.com/JohnSundell/Files.git", from: "2.0.0"),
16-
.package(url: "https://github.com/kareman/SwiftShell.git", from: "4.0.0")
15+
.package(url: "https://github.com/DanielCech/Files.git", from: "2.0.0"),
16+
.package(url: "https://github.com/kareman/SwiftShell.git", from: "4.0.0"),
17+
.package(url: "https://github.com/DanielCech/Moderator.git", from: "0.0.0")
1718
],
1819
targets: [
1920
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
2021
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
2122
.target(
2223
name: "ScriptToolkit",
23-
dependencies: ["Files", "SwiftShell"]),
24+
dependencies: ["Files", "SwiftShell", "Moderator"]),
2425
.testTarget(
2526
name: "ScriptToolkitTests",
2627
dependencies: ["ScriptToolkit"]),

Sources/ScriptToolkit/FileExtension.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
import Foundation
9+
import Files
910

1011
public extension File {
1112
@discardableResult public func createDuplicate(withName newName: String, keepExtension: Bool = true) throws -> File {

Sources/ScriptToolkit/FolderExtension.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77

88
import Foundation
9+
import Files
910

1011
public extension Folder {
1112
@discardableResult public func createDuplicate(withName newName: String, keepExtension: Bool = true) throws -> Folder {
@@ -37,3 +38,4 @@ public extension Folder {
3738
}
3839
}
3940
}
41+

Sources/ScriptToolkit/ParameterProcessing.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
//
77

88
import Foundation
9+
import SwiftShell
10+
import Moderator
911

1012
public protocol StringAssignable {
1113
mutating func assign(value: String) throws
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// String+Paths.swift
3+
// ScriptToolkit
4+
//
5+
// Created by Dan Cech on 15.02.2019.
6+
//
7+
8+
import Foundation
9+
10+
extension String {
11+
12+
var lastPathComponent: String {
13+
return (self as NSString).lastPathComponent
14+
}
15+
var pathExtension: String {
16+
return (self as NSString).pathExtension
17+
}
18+
var deletingLastPathComponent: String {
19+
return (self as NSString).deletingLastPathComponent
20+
}
21+
var deletingPathExtension: String {
22+
return (self as NSString).deletingPathExtension
23+
}
24+
var pathComponents: [String] {
25+
return (self as NSString).pathComponents
26+
}
27+
func appendingPathComponent(path: String) -> String {
28+
let nsString = self as NSString
29+
return nsString.appendingPathComponent(path)
30+
}
31+
func appendingPathExtension(ext: String) -> String? {
32+
let nsString = self as NSString
33+
return nsString.appendingPathExtension(ext)
34+
}
35+
}

0 commit comments

Comments
 (0)