Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

chore: update .gitignore to include autogenerated plugin permissions and ensure download.bat is tracked

dev-miro26203b1ae1969e
diff --git a/src-tauri/.gitignore b/src-tauri/.gitignore
index 02bc782bf..96c958f28 100644
--- a/src-tauri/.gitignore
+++ b/src-tauri/.gitignore
@@ -5,4 +5,7 @@
/gen/android
binaries
!binaries/download.sh
-!binaries/download.bat
\ No newline at end of file
+!binaries/download.bat
+
+# Autogenerated plugin permissions
+plugins/*/permissions/autogenerated/
\ No newline at end of file
diff --git a/src-tauri/build.rs b/src-tauri/build.rs
index c49b69472..639182a1f 100644
--- a/src-tauri/build.rs
+++ b/src-tauri/build.rs
@@ -1,42 +1,6 @@
fn main() {
#[cfg(not(feature = "cli"))]
{
- // Conditionally add foundation-models permissions to capability files
- #[cfg(feature = "foundation-models")]
- {
- use std::fs;
- use std::path::Path;
-
- let capabilities_dir = Path::new("capabilities");
- let files = ["default.json", "desktop.json"];
-
- for file in &files {
- let file_path = capabilities_dir.join(file);
- if let Ok(content) = fs::read_to_string(&file_path) {
- if let Ok(mut json) = serde_json::from_str::<serde_json::Value>(&content) {
- if let Some(permissions) = json.get_mut("permissions").and_then(|p| p.as_array_mut()) {
- // Check if foundation-models permission already exists
- let has_foundation_models = permissions.iter().any(|p| {
- p.as_str().map_or(false, |s| s == "foundation-models:default")
- });
-
- if !has_foundation_models {
- // Find the position after mlx:default
- if let Some(mlx_idx) = permissions.iter().position(|p| {
- p.as_str().map_or(false, |s| s == "mlx:default")
- }) {
- permissions.insert(mlx_idx + 1, serde_json::Value::String("foundation-models:default".to_string()));
- if let Ok(updated_content) = serde_json::to_string_pretty(&json) {
- let _ = fs::write(&file_path, updated_content);
- }
- }
- }
- }
- }
- }
- }
- }
-
tauri_build::build();
}