timetrack works locally

This commit is contained in:
Sebastian Moser
2026-10-11 22:20:46 +02:00
parent c19de1ed84
commit 759e6cad66
6 changed files with 52 additions and 18 deletions

View File

@@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};
use std::fs::OpenOptions;
use std::io::Write;
use std::{path::PathBuf, thread};
use tracing::info;
use tracing::{info, warn};
// console_log macro
// that can be copied into other files for debugging purposes
@@ -658,6 +658,11 @@ fn update_spacetimedb_token(new_token: &str) -> MizeResult<()> {
let file_path = config_dir.join("spacetime").join("cli.toml");
if !file_path.exists() {
warn!("spacetime config file does not exist, not updating token there");
return Ok(());
};
// Read existing file (or create empty document if it doesn't exist)
let content = std::fs::read_to_string(&file_path).unwrap_or_default();
let mut data = ItemData::from_toml(content.as_str())?;