-
Notifications
You must be signed in to change notification settings - Fork 121
/
CheckDropboxForConflictedCopies.ahk
49 lines (41 loc) · 1.33 KB
/
CheckDropboxForConflictedCopies.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include FcnLib.ahk
;remove conflicted dropbox files, (if possible)
;and record the remaining conflicted copies in the dropbox
Loop, C:\Dropbox\*, 0, 1
{
thisFile := A_LoopFileName
thisFilePath := A_LoopFileFullPath
count++
if RegExMatch(thisFile, "'s conflicted copy \d\d\d\d-\d\d-\d\d\)\.")
{
;clean it up, if possible
if RegExMatch(thisFilePath, "^\QC:\Dropbox\Programs\FirefoxPortable\Data\profile\\E")
{
FileDelete(thisFilePath)
if NOT FileExist(thisFilePath)
continue
}
;cleanup not possible, record it
conflictedList .= "`n" . thisFilePath
matchCount++
}
}
;addtotrace("number of files:", count, matchCount)
outputFile=C:\Dropbox\AHKs\gitExempt\morning_status\dropboxInfo.txt
message=There are %matchCount% conflicted copy files in the Dropbox.
if (matchCount > 15)
FileAppendLine(message, outputFile)
errord("nolog", message, conflictedList)
ExitApp
;TODO we should probably move the cleanup portions of the script to a function
;but I'm not sure how I'd like that to look yet
;probably should do that later, when we get multiple sections
;TODO I think I'd be more comfortable with two loops, but that seems like it would be copypasta
IsConflictedFile()
{
return bool
}
RemoveConflictedFile()
{
return bool
}