File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
NotifierBot/Sources/Notifier/Commands
urlwatcher/Sources/urlwatcher Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ struct RemoveCommand: Command {
3636 let realName = config [ index!] . name
3737 config. remove ( at: index!)
3838 try ConfigParser . saveConfig ( config)
39+
40+ // Remove the images folder
41+ let folderPath = " \( mainDirectory!) /urlwatcher/images/ \( realName) . \( chatID) "
42+ try FileManager . default. removeItem ( atPath: folderPath)
43+
3944 try bot. sendMessage ( " Successfully removed ' \( realName) ' " , to: chatID)
4045 }
4146
Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ func handleScreenshotError(entry: URLEntry) throws {
9696 // We do this, by checking for a file 'error' and its creation date to see when the error first appeared.
9797 // This file should be deleted on the next successful capture
9898 if !fileManager. fileExists ( atPath: errorFile) {
99+ print ( " Creating error file at \( errorFile) " )
99100 // If the error file does not exist yet, create a new one and return
100101 fileManager. createFile ( atPath: errorFile, contents: nil )
101102 return
You can’t perform that action at this time.
0 commit comments