Skip to content

Commit 94d654b

Browse files
committed
[fix]: flatten
1 parent f666332 commit 94d654b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Sources/ScriptToolkit/FolderExtension.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,13 @@ public extension Folder {
4343
////////////////////////////////////////////////////////////////////////////////
4444
// MARK: - Flatten folder structure
4545

46-
public func flattenFolderStructure(inputDir: String, outputDir: String, move: Bool) throws {
47-
let inputFolder = try Folder(path: inputDir)
46+
public func flattenFolderStructure(outputDir: String, move: Bool) throws {
4847
let outputFolder = try Folder(path: outputDir)
4948

50-
let inputFolderPath = inputFolder.path
49+
let inputFolderPath = path
5150
let index = inputFolderPath.index(inputFolderPath.startIndex, offsetBy: inputFolderPath.count)
5251

53-
try inputFolder.makeSubfolderSequence(recursive: true).forEach { folder in
52+
try makeSubfolderSequence(recursive: true).forEach { folder in
5453
print("folder: \(folder), files: \(folder.files)")
5554
let folderPath = folder.path[index...]
5655
let folderPrefix = folderPath.replacingOccurrences(of: "/", with: " ")

0 commit comments

Comments
 (0)