summaryrefslogtreecommitdiff
path: root/cli/args/flags.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-11-13 09:44:01 -0500
committerGitHub <noreply@github.com>2023-11-13 09:44:01 -0500
commit6e1f3aa0131f145db631d5dfb94c2b9404172194 (patch)
tree2d48695f5efb15312e7e78c1fa0d2addfd0a03f5 /cli/args/flags.rs
parent542314a0becbba120dbee13b3f410f647b4c9cb7 (diff)
fix(install): should work with non-existent relative root (#21161)
Closes #21160
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r--cli/args/flags.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 4bad30140..96cd0bbfe 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -163,7 +163,7 @@ pub struct InstallFlags {
pub module_url: String,
pub args: Vec<String>,
pub name: Option<String>,
- pub root: Option<PathBuf>,
+ pub root: Option<String>,
pub force: bool,
}
@@ -177,7 +177,7 @@ pub struct JupyterFlags {
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct UninstallFlags {
pub name: String,
- pub root: Option<PathBuf>,
+ pub root: Option<String>,
}
#[derive(Clone, Debug, Eq, PartialEq)]
@@ -1762,7 +1762,6 @@ These must be added to the path manually if required.")
Arg::new("root")
.long("root")
.help("Installation root")
- .value_parser(value_parser!(PathBuf))
.value_hint(ValueHint::DirPath))
.arg(
Arg::new("force")
@@ -1822,7 +1821,6 @@ The installation root is determined, in order of precedence:
Arg::new("root")
.long("root")
.help("Installation root")
- .value_parser(value_parser!(PathBuf))
.value_hint(ValueHint::DirPath))
)
}
@@ -3407,7 +3405,7 @@ fn info_parse(flags: &mut Flags, matches: &mut ArgMatches) {
fn install_parse(flags: &mut Flags, matches: &mut ArgMatches) {
runtime_args_parse(flags, matches, true, true);
- let root = matches.remove_one::<PathBuf>("root");
+ let root = matches.remove_one::<String>("root");
let force = matches.get_flag("force");
let name = matches.remove_one::<String>("name");
@@ -3438,7 +3436,7 @@ fn jupyter_parse(flags: &mut Flags, matches: &mut ArgMatches) {
}
fn uninstall_parse(flags: &mut Flags, matches: &mut ArgMatches) {
- let root = matches.remove_one::<PathBuf>("root");
+ let root = matches.remove_one::<String>("root");
let name = matches.remove_one::<String>("name").unwrap();
flags.subcommand = DenoSubcommand::Uninstall(UninstallFlags { name, root });
@@ -6361,7 +6359,7 @@ mod tests {
name: Some("file_server".to_string()),
module_url: "https://deno.land/std/http/file_server.ts".to_string(),
args: svec!["foo", "bar"],
- root: Some(PathBuf::from("/foo")),
+ root: Some("/foo".to_string()),
force: true,
}),
import_map_path: Some("import_map.json".to_string()),