mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 07:05:47 +02:00
make cp can copy folders contains dangling symbolic link (#5645)
* cp with no dangling link * add -p to not follow symbolic link * change comment * add one more test case to check symblink body after copied * better help message
This commit is contained in:
@ -228,7 +228,9 @@ impl<'a> Playground<'a> {
|
||||
|
||||
pub fn within(&mut self, directory: &str) -> &mut Self {
|
||||
self.cwd.push(directory);
|
||||
std::fs::create_dir(&self.cwd).expect("can not create directory");
|
||||
if !(self.cwd.exists() && self.cwd.is_dir()) {
|
||||
std::fs::create_dir(&self.cwd).expect("can not create directory");
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user