fix(rust_indexer): don't try to canonicalize tmp_directory
@@ -21,7 +21,7 @@ use anyhow::{anyhow, Context, Result};
use clap::{App, Arg};
use serde_json::Value;
use std::{
- fs::{self, File},
+ fs::File,
io::{self, Write},
path::{Path, PathBuf},
};
@@ -41,7 +41,11 @@ fn main() -> Result<()> {
// Get the absolute path of the tmp_directory argument or default to /tmp
let tmp_path_arg = {
if let Some(arg) = matches.value_of("tmp_directory") {
- fs::canonicalize(arg).context("Failed to canonicalize tmp_directory path")?
+ let path = PathBuf::new().join(arg);
+ if !path.is_dir() {
+ panic!("tmp_directory argument \"{}\" does not exist", arg);
+ }
+ path
} else {
std::env::temp_dir()
}
