fixed push command to store current directory before changing directory
This commit is contained in:
+3
-1
@@ -3,6 +3,7 @@ mod stack;
|
|||||||
|
|
||||||
use std::io::{Result, Error, ErrorKind};
|
use std::io::{Result, Error, ErrorKind};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
use std::env::current_dir;
|
||||||
use clap::{FromArgMatches, Parser};
|
use clap::{FromArgMatches, Parser};
|
||||||
use arguments::*;
|
use arguments::*;
|
||||||
use stack::Stack;
|
use stack::Stack;
|
||||||
@@ -22,7 +23,8 @@ fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_push (args: &PushArgs, stack: &mut Stack) -> Result<()> { // TODO: handle arguments
|
pub fn handle_push (args: &PushArgs, stack: &mut Stack) -> Result<()> { // TODO: handle arguments
|
||||||
stack.push_entry(&args.path)?;
|
let current_path = current_dir()?;
|
||||||
|
stack.push_entry(¤t_path)?;
|
||||||
println!("{}", args.path.to_str().unwrap());
|
println!("{}", args.path.to_str().unwrap());
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user