Leave a team, delete a vault; keep tests out of the real settings
- A hub test unset LUNE_HOME for the whole test run, so later tests saved into the real user's config. Tests now always keep their own settings folder. - Leaving a team: `lunesync leave` and the app's Leave hand over and remove this device there; a hub that's gone can be forgotten (folders stay). - Deleting a vault (owner): everyone is removed the usual way, the history is archived on the hub and the name is freed. Canvas asks first. - Connect this Mac says what to do when Lune isn't installed. - Update checks skip http hubs instead of failing for all of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -121,6 +121,12 @@ enum Command {
|
||||
#[arg(long)]
|
||||
without_saving: bool,
|
||||
},
|
||||
/// Leave a team on this device: hands over anything unshared and removes this device there (--team picks which)
|
||||
Leave {
|
||||
/// The team's hub is gone for good: just forget it here (its folders stay, no longer synced)
|
||||
#[arg(long)]
|
||||
forget: bool,
|
||||
},
|
||||
/// Remove someone from the team, or bring them back (team owner)
|
||||
Team {
|
||||
#[command(subcommand)]
|
||||
@@ -183,6 +189,13 @@ enum VaultCmd {
|
||||
#[arg(long)]
|
||||
delete_from_devices: OnOff,
|
||||
},
|
||||
/// Delete a vault (team owner): everyone's devices send unshared work, then remove their copy; the history stays archived on the hub
|
||||
Delete {
|
||||
name: String,
|
||||
/// Yes, delete it
|
||||
#[arg(long)]
|
||||
yes: bool,
|
||||
},
|
||||
/// Move a vault from its plain Git remote onto the hub
|
||||
Upload {
|
||||
name: String,
|
||||
@@ -303,6 +316,12 @@ fn run_cli(cli: Cli) -> Result<()> {
|
||||
Command::Join { link, name, vaults_dir } => team::join(&mut config, &link, &name, vaults_dir)?,
|
||||
Command::Login { hub, code, name, vaults_dir } => team::login(&mut config, &hub, &code, &name, vaults_dir)?,
|
||||
Command::Pair => team::pair(&config)?,
|
||||
Command::Leave { forget } => {
|
||||
let url = team::link(&config)?.url.clone();
|
||||
for msg in lune_core::membership::leave_hub(&mut config, &url, forget)? {
|
||||
println!("{msg}");
|
||||
}
|
||||
}
|
||||
Command::Open => {
|
||||
let url = team::link(&config)?.web_link()?;
|
||||
let opener = if cfg!(target_os = "macos") { "open" } else { "xdg-open" };
|
||||
@@ -325,6 +344,13 @@ fn run_cli(cli: Cli) -> Result<()> {
|
||||
HandoverCmd::Discard { id } => team::handover_decide(&config, id, "discard")?,
|
||||
HandoverCmd::Skip { id } => team::handover_decide(&config, id, "skip")?,
|
||||
},
|
||||
Command::Vault { action: VaultCmd::Delete { name, yes } } => {
|
||||
if !yes {
|
||||
bail!("deleting {name} ends everyone's access to it; run again with --yes if that's what you want");
|
||||
}
|
||||
let n = team::link(&config)?.delete_vault(&name)?;
|
||||
println!("Deleted {name}. {n} device(s) send anything unshared, then remove their copy; the history stays archived on the hub.");
|
||||
}
|
||||
Command::Vault { action: VaultCmd::Set { name, delete_from_devices } } => {
|
||||
team::link(&config)?.vault_setting(&name, matches!(delete_from_devices, OnOff::On))?;
|
||||
let what = match delete_from_devices {
|
||||
|
||||
Reference in New Issue
Block a user