Skip to content

Commit

Permalink
fix: windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Jul 29, 2024
1 parent 86e6ef0 commit be70ed2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/apps/screenpipe-app-tauri/scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ if (hasFeature('rocm')) {
// Development hints
if (!process.env.GITHUB_ENV) {
console.log('\nCommands to build 🔨:')
if (originalCWD != cwd) {
// Get relative path to desktop folder
const relativePath = path.relative(originalCWD, path.join(cwd, '..'))
// Get relative path to screenpipe-app-tauri folder
const relativePath = path.relative(originalCWD, path.join(cwd, '..'))
if (originalCWD != cwd && relativePath != '') {
console.log(`cd ${relativePath}`)
}
console.log('bun install')
Expand Down
21 changes: 21 additions & 0 deletions examples/apps/screenpipe-app-tauri/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use dirs::home_dir;
use log::{debug, error, info, LevelFilter};
use logs::MultiWriter;
use tauri::Config;
use tauri_plugin_shell::ShellExt;

use serde_json::Value;
Expand Down Expand Up @@ -184,6 +185,26 @@ async fn main() {

let stores = app.app_handle().state::<StoreCollection<Wry>>();

// Initialize the store with default values if it doesn't exist
let _ = with_store(
app.app_handle().clone(),
stores.clone(),
path.clone(),
|store| {
if store.keys().count() == 0 {
// Set default values
store.insert("analytics_enabled".to_string(), Value::Bool(true))?;
store.insert(
"config".to_string(),
serde_json::to_value(Config::default())?,
)?;
store.save()?;
}
Ok(())
},
);

// Now use the store
let _ = with_store(app.app_handle().clone(), stores, path, |store| {
store.save()?;

Expand Down

0 comments on commit be70ed2

Please sign in to comment.