Skip to content

Commit bc3715b

Browse files
committed
fix: mis placed configs
1 parent fff4e52 commit bc3715b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

Lib/RabbitCommon.ahk

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ CleanOldLogs() {
176176
}
177177
}
178178

179+
CleanMisPlacedConfigs() {
180+
shared := RabbitSharedDataPath()
181+
user := RabbitUserDataPath()
182+
183+
if shared == user
184+
return
185+
186+
if FileExist(user . "\default.yaml") {
187+
RabbitWarn(Format("renaming unnecessary file {}\default.yaml", user), Format("RabbitCommon.ahk:{}", A_LineNumber))
188+
FileMove(user . "\default.yaml", user . "\default.yaml.old", 1)
189+
}
190+
if FileExist(user . "\rabbit.yaml") {
191+
RabbitWarn(Format("renaming unnecessary file {}\rabbit.yaml", user), Format("RabbitCommon.ahk:{}", A_LineNumber))
192+
FileMove(user . "\rabbit.yaml", user . "\rabbit.yaml.old", 1)
193+
}
194+
}
195+
179196
RabbitLog(text) {
180197
try {
181198
FileAppend(text, "*", "UTF-8")
@@ -194,6 +211,10 @@ RabbitError(text, location, limit := -1) {
194211
msg := Format("E{} {:5} {}] {}`r`n", FormatTime(, "yyyyMMdd HH:mm:ss "), ProcessExist(), location, text)
195212
RabbitLogLimit(msg, location, limit)
196213
}
214+
RabbitWarn(text, location, limit := -1) {
215+
msg := Format("W{} {:5} {}] {}`r`n", FormatTime(, "yyyyMMdd HH:mm:ss "), ProcessExist(), location, text)
216+
RabbitLogLimit(msg, location, limit)
217+
}
197218
RabbitInfo(text, location, limit := -1) {
198219
msg := Format("I{} {:5} {}] {}`r`n", FormatTime(, "yyyyMMdd HH:mm:ss "), ProcessExist(), location, text)
199220
RabbitLogLimit(msg, location, limit)

Rabbit.ahk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ RabbitMain(args) {
9999
}
100100

101101
CleanOldLogs()
102+
CleanMisPlacedConfigs()
102103
RabbitConfig.load()
103104
if RabbitConfig.use_legacy_candidate_box
104105
box := LegacyCandidateBox()

0 commit comments

Comments
 (0)