style: applied formatting to the new update feature
This commit is contained in:
+6
-10
@@ -1,13 +1,13 @@
|
||||
use std::fs::OpenOptions;
|
||||
use crate::utils::warning_text;
|
||||
use anyhow::{Context, Result, bail};
|
||||
use dunce::canonicalize;
|
||||
use inquire::Confirm;
|
||||
use is_terminal::IsTerminal;
|
||||
use self_update::Status;
|
||||
use self_update::backends::github::Update;
|
||||
use std::fs::OpenOptions;
|
||||
use std::path::Path;
|
||||
use std::{env, fs, io, process};
|
||||
use dunce::canonicalize;
|
||||
use self_update::backends::github::Update;
|
||||
use self_update::Status;
|
||||
use crate::utils::warning_text;
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
enum InstallSource {
|
||||
@@ -70,11 +70,7 @@ fn normalize_version(requested: Option<String>) -> Option<String> {
|
||||
|
||||
fn is_dir_writable(dir: &Path) -> bool {
|
||||
let probe = dir.join(format!(".loki-update-write-test-{}", process::id()));
|
||||
match OpenOptions::new()
|
||||
.write(true)
|
||||
.create_new(true)
|
||||
.open(&probe)
|
||||
{
|
||||
match OpenOptions::new().write(true).create_new(true).open(&probe) {
|
||||
Ok(_) => {
|
||||
let _ = fs::remove_file(&probe);
|
||||
true
|
||||
|
||||
+1
-2
@@ -553,8 +553,7 @@ pub async fn run_repl_command(
|
||||
bail!("Cannot perform this operation because you are in a macro")
|
||||
}
|
||||
let version = args.map(|s| s.trim().to_string());
|
||||
task::spawn_blocking(move || config::run_self_update(version, false))
|
||||
.await??;
|
||||
task::spawn_blocking(move || config::run_self_update(version, false)).await??;
|
||||
}
|
||||
".rag" => {
|
||||
ctx.use_rag(args, abort_signal.clone()).await?;
|
||||
|
||||
Reference in New Issue
Block a user