mirror of
https://github.com/rememberber/MooTool.git
synced 2026-12-01 03:18:19 +08:00
Honor collapsed caret when the editor is first responder; only fall back to persisted selection after focus leaves the panel. Surface ~/.MooTool SQLite detection in migration settings and align vault/Git docs with 0.8 behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
770 B
Swift
21 lines
770 B
Swift
import Foundation
|
|
|
|
/// Default Java desktop edition data root (`~/.MooTool`), used for migration hints only.
|
|
public enum LegacyJavaDataPaths {
|
|
public static var defaultDirectory: URL {
|
|
FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent(".MooTool", isDirectory: true)
|
|
}
|
|
|
|
public static func legacyDatabaseURL(in root: URL = defaultDirectory) -> URL? {
|
|
let candidates = [
|
|
root.appendingPathComponent("MooTool.db"),
|
|
root.appendingPathComponent("database/MooTool.db")
|
|
]
|
|
return candidates.first { FileManager.default.fileExists(atPath: $0.path) }
|
|
}
|
|
|
|
public static func hasLegacyInstall(at root: URL = defaultDirectory) -> Bool {
|
|
legacyDatabaseURL(in: root) != nil
|
|
}
|
|
}
|