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