Begin porting mkdir (#3607)

* Begin porting mkdir

* Addressed comments
This commit is contained in:
Sam Bordo 2021-06-14 14:57:21 -04:00 committed by GitHub
parent 6f0dd8e885
commit d60d71a697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -22,7 +22,7 @@ impl WholeStreamCommand for Mkdir {
"Make directories, creates intermediary directories as required."
}
fn run_with_actions(&self, args: CommandArgs) -> Result<ActionStream, ShellError> {
fn run(&self, args: CommandArgs) -> Result<OutputStream, ShellError> {
mkdir(args)
}
@ -35,7 +35,7 @@ impl WholeStreamCommand for Mkdir {
}
}
fn mkdir(args: CommandArgs) -> Result<ActionStream, ShellError> {
fn mkdir(args: CommandArgs) -> Result<OutputStream, ShellError> {
let name = args.call_info.name_tag.clone();
let shell_manager = args.shell_manager();

View File

@ -479,7 +479,7 @@ impl Shell for FilesystemShell {
}: MkdirArgs,
name: Tag,
path: &str,
) -> Result<ActionStream, ShellError> {
) -> Result<OutputStream, ShellError> {
let path = Path::new(path);
let mut stream = VecDeque::new();
@ -504,7 +504,7 @@ impl Shell for FilesystemShell {
}
if show_created_paths {
let val = format!("{:}", create_at.to_string_lossy()).into();
stream.push_back(Ok(ReturnSuccess::Value(val)));
stream.push_back(val);
}
}

View File

@ -29,7 +29,7 @@ pub trait Shell: std::fmt::Debug {
) -> Result<ActionStream, ShellError>;
fn cd(&self, args: CdArgs, name: Tag) -> Result<ActionStream, ShellError>;
fn cp(&self, args: CopyArgs, name: Tag, path: &str) -> Result<ActionStream, ShellError>;
fn mkdir(&self, args: MkdirArgs, name: Tag, path: &str) -> Result<ActionStream, ShellError>;
fn mkdir(&self, args: MkdirArgs, name: Tag, path: &str) -> Result<OutputStream, ShellError>;
fn mv(&self, args: MvArgs, name: Tag, path: &str) -> Result<ActionStream, ShellError>;
fn rm(&self, args: RemoveArgs, name: Tag, path: &str) -> Result<ActionStream, ShellError>;
fn path(&self) -> String;

View File

@ -172,7 +172,7 @@ impl ShellManager {
shells[self.current_shell()].rm(args, name, &path)
}
pub fn mkdir(&self, args: MkdirArgs, name: Tag) -> Result<ActionStream, ShellError> {
pub fn mkdir(&self, args: MkdirArgs, name: Tag) -> Result<OutputStream, ShellError> {
let shells = self.shells.lock();
let path = shells[self.current_shell()].path();

View File

@ -197,7 +197,7 @@ impl Shell for ValueShell {
))
}
fn mkdir(&self, _args: MkdirArgs, name: Tag, _path: &str) -> Result<ActionStream, ShellError> {
fn mkdir(&self, _args: MkdirArgs, name: Tag, _path: &str) -> Result<OutputStream, ShellError> {
Err(ShellError::labeled_error(
"mkdir not currently supported on values",
"not currently supported",