summaryrefslogtreecommitdiff
path: root/cli/ops
diff options
context:
space:
mode:
authorRy Dahl <ry@tinyclouds.org>2019-12-18 09:29:00 -0500
committerGitHub <noreply@github.com>2019-12-18 09:29:00 -0500
commit077b6f7672b0d92edc9488622790d78fd8ab20c4 (patch)
tree3becfc0d6a68314f12a67dae0554e804d0aa6a2f /cli/ops
parentff6b514a7b1087e7e5f363305cce46b513a3e562 (diff)
Reduce all directory functions to Deno.dir() (#3518)
Diffstat (limited to 'cli/ops')
-rw-r--r--cli/ops/os.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/ops/os.rs b/cli/ops/os.rs
index 13fadbf6d..03f81838c 100644
--- a/cli/ops/os.rs
+++ b/cli/ops/os.rs
@@ -60,7 +60,7 @@ fn op_start(
#[derive(Deserialize)]
struct GetDirArgs {
- name: std::string::String,
+ kind: std::string::String,
}
fn op_get_dir(
@@ -71,7 +71,7 @@ fn op_get_dir(
state.check_env()?;
let args: GetDirArgs = serde_json::from_value(args)?;
- let path = match args.name.as_str() {
+ let path = match args.kind.as_str() {
"home" => dirs::home_dir(),
"config" => dirs::config_dir(),
"cache" => dirs::cache_dir(),
@@ -89,7 +89,7 @@ fn op_get_dir(
_ => {
return Err(ErrBox::from(Error::new(
ErrorKind::InvalidInput,
- format!("Invalid dir type `{}`", args.name.as_str()),
+ format!("Invalid dir type `{}`", args.kind.as_str()),
)))
}
};
@@ -97,7 +97,7 @@ fn op_get_dir(
if path == None {
Err(ErrBox::from(Error::new(
ErrorKind::NotFound,
- format!("Could not get user {} directory.", args.name.as_str()),
+ format!("Could not get user {} directory.", args.kind.as_str()),
)))
} else {
Ok(JsonOp::Sync(json!(path