Skip to content

Commit

Permalink
Create parent dir for preference.db on first launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Aug 17, 2023
1 parent 598166e commit e4f6f31
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion annix/src/preferences/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ pub struct NativePreferenceStore {

impl NativePreferenceStore {
pub fn new(root: String) -> SyncReturn<NativePreferenceStore> {
let db_path = PathBuf::from(root).join("preference.db");
let db_path = PathBuf::from(&root).join("preference.db");
std::fs::create_dir_all(&root).unwrap();
let conn = Connection::open(db_path).unwrap();
conn.execute(
r#"
Expand Down
18 changes: 9 additions & 9 deletions macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ PODS:
- FlutterMacOS
- audioplayers_darwin (0.0.1):
- FlutterMacOS
- bitsdojo_window_macos (0.0.1):
- FlutterMacOS
- connectivity_plus (0.0.1):
- FlutterMacOS
- ReachabilitySwift
Expand All @@ -17,6 +15,8 @@ PODS:
- ReachabilitySwift (5.0.0)
- share_plus (0.0.1):
- FlutterMacOS
- simple_audio (1.5.5):
- FlutterMacOS
- sqlite3 (3.39.3):
- sqlite3/common (= 3.39.3)
- sqlite3/common (3.39.3)
Expand All @@ -39,11 +39,11 @@ DEPENDENCIES:
- audio_service (from `Flutter/ephemeral/.symlinks/plugins/audio_service/macos`)
- audio_session (from `Flutter/ephemeral/.symlinks/plugins/audio_session/macos`)
- audioplayers_darwin (from `Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos`)
- bitsdojo_window_macos (from `Flutter/ephemeral/.symlinks/plugins/bitsdojo_window_macos/macos`)
- connectivity_plus (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos`)
- FlutterMacOS (from `Flutter/ephemeral`)
- path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`)
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
- simple_audio (from `Flutter/ephemeral/.symlinks/plugins/simple_audio/macos`)
- sqlite3_flutter_libs (from `Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos`)
- url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)

Expand All @@ -59,8 +59,6 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/audio_session/macos
audioplayers_darwin:
:path: Flutter/ephemeral/.symlinks/plugins/audioplayers_darwin/macos
bitsdojo_window_macos:
:path: Flutter/ephemeral/.symlinks/plugins/bitsdojo_window_macos/macos
connectivity_plus:
:path: Flutter/ephemeral/.symlinks/plugins/connectivity_plus/macos
FlutterMacOS:
Expand All @@ -69,6 +67,8 @@ EXTERNAL SOURCES:
:path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin
share_plus:
:path: Flutter/ephemeral/.symlinks/plugins/share_plus/macos
simple_audio:
:path: Flutter/ephemeral/.symlinks/plugins/simple_audio/macos
sqlite3_flutter_libs:
:path: Flutter/ephemeral/.symlinks/plugins/sqlite3_flutter_libs/macos
url_launcher_macos:
Expand All @@ -78,16 +78,16 @@ SPEC CHECKSUMS:
audio_service: b88ff778e0e3915efd4cd1a5ad6f0beef0c950a9
audio_session: dea1f41890dbf1718f04a56f1d6150fd50039b72
audioplayers_darwin: dcad41de4fbd0099cb3749f7ab3b0cb8f70b810c
bitsdojo_window_macos: 44e3b8fe3dd463820e0321f6256c5b1c16bb6a00
connectivity_plus: 18d3c32514c886e046de60e9c13895109866c747
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
path_provider_foundation: 37748e03f12783f9de2cb2c4eadfaa25fe6d4852
path_provider_foundation: c68054786f1b4f3343858c1e1d0caaded73f0be9
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
simple_audio: c457f2bd013bf6978b4dff4cb00d62d294af1c56
sqlite3: 50117e9e063a9ef2b865f7bdf2f2601e5d368e9a
sqlite3_flutter_libs: cfe190df811dcc0a495dc7ab09d3cda5f92740d2
url_launcher_macos: c04e4fa86382d4f94f6b38f14625708be3ae52e2
url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451

PODFILE CHECKSUM: 6ee491d2834a2beb2dd96dda71c0adb8387b6b89

COCOAPODS: 1.11.2
COCOAPODS: 1.12.1
2 changes: 1 addition & 1 deletion macos/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>FlutterApplication</string>
<string>NSApplication</string>
</dict>
</plist>

0 comments on commit e4f6f31

Please sign in to comment.