Signed-off-by: renoseven <dev@renoseven.net> (cherry picked from commit ef53460df585f2572812c41491306d6c21c207eb)
53 lines
1.3 KiB
Diff
53 lines
1.3 KiB
Diff
From 707475a7361b6f16ca2b9e62f222b1982a57e506 Mon Sep 17 00:00:00 2001
|
|
From: renoseven <dev@renoseven.net>
|
|
Date: Mon, 10 Feb 2025 14:21:29 +0800
|
|
Subject: [PATCH] syscare: remove working directory check
|
|
|
|
Signed-off-by: renoseven <dev@renoseven.net>
|
|
---
|
|
syscare/src/args.rs | 14 ++------------
|
|
1 file changed, 2 insertions(+), 12 deletions(-)
|
|
|
|
diff --git a/syscare/src/args.rs b/syscare/src/args.rs
|
|
index 4f034a0..5e7299d 100644
|
|
--- a/syscare/src/args.rs
|
|
+++ b/syscare/src/args.rs
|
|
@@ -14,7 +14,7 @@
|
|
|
|
use std::path::PathBuf;
|
|
|
|
-use anyhow::{ensure, Result};
|
|
+use anyhow::Result;
|
|
use clap::{AppSettings, ColorChoice, Parser, Subcommand};
|
|
|
|
use syscare_common::fs;
|
|
@@ -131,7 +131,7 @@ pub enum SubCommand {
|
|
|
|
impl Arguments {
|
|
pub fn new() -> Result<Self> {
|
|
- Self::parse().normalize_path().and_then(Self::check)
|
|
+ Self::parse().normalize_path()
|
|
}
|
|
|
|
fn normalize_path(mut self) -> Result<Self> {
|
|
@@ -139,16 +139,6 @@ impl Arguments {
|
|
|
|
Ok(self)
|
|
}
|
|
-
|
|
- fn check(self) -> Result<Self> {
|
|
- let work_dir = &self.work_dir;
|
|
- ensure!(
|
|
- work_dir.is_dir(),
|
|
- format!("Cannot find directory {}", work_dir.display())
|
|
- );
|
|
-
|
|
- Ok(self)
|
|
- }
|
|
}
|
|
|
|
impl std::fmt::Display for Arguments {
|
|
--
|
|
2.34.1
|
|
|