aKode: comando akode update e avviso di nuova versione
- Nuovo crate akode-update: legge l'ultima release dal repository Gitea configurato ([update] repo_url, predefinito git.difonzo.net/andrea/aKode; 404 = nessun aggiornamento), confronta la semver, scarica akode-<versione>-<target>.tar.gz solo dallo stesso host, verifica lo SHA-256 e sostituisce il binario in modo atomico tenendo akode.old (nel layout a pacchetto aggiorna anche akode-package.json o l'intero pacchetto). - `akode update [--check]` con messaggi in italiano; mai installazioni automatiche. - TUI: controllo in background all'avvio al massimo ogni 24 h (update-check.json in AKODE_HOME), avviso su una riga, disattivabile con [update] check_on_startup = false. - Rimossi il prompt di aggiornamento e le azioni npm/brew/installer di OpenAI ormai inutilizzati; il doctor mostra sorgente e ultimo controllo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,36 +5,6 @@ use akode_tui::DaemonUpdateSource;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
|
||||
#[test]
|
||||
fn package_update_runs_outside_the_project() -> anyhow::Result<()> {
|
||||
const CHILD: &str = "AKODE_TEST_PACKAGE_UPDATE_CHILD";
|
||||
if std::env::var_os(CHILD).is_some() {
|
||||
return run_update_action(UpdateAction::PnpmGlobalLatest, /*cli_executable*/ None);
|
||||
}
|
||||
|
||||
let project = tempfile::tempdir()?;
|
||||
let bin = tempfile::tempdir()?;
|
||||
akode_utils_cargo_bin::write_executable(
|
||||
&bin.path().join("pnpm"),
|
||||
"#!/bin/sh\npwd -P > \"$0.cwd\"\n",
|
||||
)?;
|
||||
assert_cmd::Command::new(std::env::current_exe()?)
|
||||
.args([
|
||||
"--exact",
|
||||
"daemon_update_tests::package_update_runs_outside_the_project",
|
||||
])
|
||||
.current_dir(project.path())
|
||||
.env("TMPDIR", project.path())
|
||||
.env("PATH", bin.path())
|
||||
.env(CHILD, "1")
|
||||
.assert()
|
||||
.success();
|
||||
|
||||
let cwd = std::fs::read_to_string(bin.path().join("pnpm.cwd"))?;
|
||||
assert!(!std::path::Path::new(cwd.trim_end()).starts_with(project.path().canonicalize()?));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn daemon_handoff_uses_selected_executable_and_propagates_failure() -> anyhow::Result<()> {
|
||||
let dir = tempfile::tempdir()?;
|
||||
|
||||
Reference in New Issue
Block a user