Skip to content

Commit

Permalink
fix: command path
Browse files Browse the repository at this point in the history
  • Loading branch information
greenhat616 committed Apr 2, 2024
1 parent 8cc9e8c commit 70c03cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions backend/tauri/src/cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ pub async fn set_custom_app_dir(app_handle: tauri::AppHandle, path: String) -> C
let args = vec![
"/C",
app_exe.as_str(),
"migrate_home_dir",
"-t",
"migrate-home-dir",
path_str.as_str(),
];
runas::Command::new("cmd")
Expand Down
12 changes: 5 additions & 7 deletions backend/tauri/src/core/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
use anyhow::Ok;
use clap::{Parser, Subcommand};

#[derive(Parser)]
#[command(version = None, about = None, long_about = None)]
#[derive(Parser, Debug)]
#[command(name = "clash-nyanpasu", version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
command: Option<Commands>,
}

#[derive(Subcommand)]
#[derive(Subcommand, Debug)]
enum Commands {
MigrateHomeDir {
#[arg(short = 't', long)]
target_path: String,
},
#[command(about = "Migrate home directory to another path.")]
MigrateHomeDir { target_path: String },
}

pub fn parse() -> anyhow::Result<()> {
Expand Down
1 change: 0 additions & 1 deletion backend/tauri/src/core/tray/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use super::storage;
use crate::{cmds, config::Config, feat, utils, utils::resolve};
use anyhow::Result;
use rust_i18n::t;
Expand Down
5 changes: 1 addition & 4 deletions backend/tauri/src/utils/dirs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use crate::core::handle;
use anyhow::Result;
use std::{path::PathBuf, sync::OnceLock};
use tauri::{
api::{
self,
path::{home_dir, resource_dir},
},
api::path::{home_dir, resource_dir},
Env,
};

Expand Down

0 comments on commit 70c03cc

Please sign in to comment.