build: Paketbau für .deb und Arch-Paket vorbereiten
Tauri-Bundle: .deb hängt von podman ab und installiert die Aufgaben nach /usr/share/coding-bench/tasks. Die App findet diesen Ordner, wenn weder Konfiguration noch Datenordner Aufgaben angeben. PKGBUILD, Desktop-Eintrag und Gitea-Workflow (.deb und Arch-Paket, Start bei Tag v* oder manuell). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -10,6 +10,8 @@ use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub const CONFIG_FILE_NAME: &str = "config.toml";
|
||||
/// Aufgaben, die ein Paket installiert. Gilt, wenn weder die Konfiguration noch der Datenordner Aufgaben angeben.
|
||||
pub const SYSTEM_TASKS_DIR: &str = "/usr/share/coding-bench/tasks";
|
||||
|
||||
/// Rohe Konfiguration, so wie sie in der Datei steht.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
@ -121,7 +123,10 @@ pub fn load_or_create(config_dir: &Path, default_data_dir: &Path) -> Result<(Pat
|
||||
defaults
|
||||
};
|
||||
|
||||
let paths = config.resolve(&config_file, default_data_dir);
|
||||
let mut paths = config.resolve(&config_file, default_data_dir);
|
||||
if config.tasks_dir.is_none() && !paths.tasks_dir.is_dir() && Path::new(SYSTEM_TASKS_DIR).is_dir() {
|
||||
paths.tasks_dir = PathBuf::from(SYSTEM_TASKS_DIR);
|
||||
}
|
||||
fs::create_dir_all(&paths.data_dir)
|
||||
.map_err(|e| format!("Datenordner {} nicht anlegbar: {e}", paths.data_dir.display()))?;
|
||||
Ok((paths, config))
|
||||
|
||||
@ -24,6 +24,14 @@
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"targets": "all",
|
||||
"linux": {
|
||||
"deb": {
|
||||
"depends": ["podman"],
|
||||
"files": {
|
||||
"/usr/share/coding-bench/tasks": "../tasks"
|
||||
}
|
||||
}
|
||||
},
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
|
||||
Reference in New Issue
Block a user