Skip to content

Commit

Permalink
Half assed implementation of (m). Bumping version to 0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyIbanez committed Jun 26, 2016
1 parent f7f6c2a commit 1ec6602
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fsduplicates/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,18 @@ if let showFlagIndex = arguments.index(of: "-s") {
do {
if let file = option.fileSelection where (file - 1) < existing.count {
let songP = songPath(existing[file - 1])
let songN = songName(songP)
consoleOutput("Attempting to move file to directory...")
//try FileManager.default().moveItem(atPath: songP, toPath: acoustidDirPath)
try FileManager.default().createDirectory(atPath: acoustidDirPath, withIntermediateDirectories: false , attributes: nil)
try FileManager.default().moveItem(atPath: songP, toPath: (acoustidDirPath + "/\(songN)"))
loggedFiles = loggedFiles.filter { return !$0.contains(songP) }
try FileManager.default().removeItem(atPath: filesAndHashesFile)
FileManager.default().createFile(atPath: filesAndHashesFile, contents: nil, attributes: nil)
for line in loggedFiles {
write(string: "\(line)\n", toFile: filesAndHashesFile)
}
consoleOutput("File moved successfully.")
continue
} else {
print("Invalid song number.")
continue
Expand Down

0 comments on commit 1ec6602

Please sign in to comment.