Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add copy/move commands #39

Merged
merged 8 commits into from
Dec 7, 2022
Merged

feat: Add copy/move commands #39

merged 8 commits into from
Dec 7, 2022

Conversation

sigmaSd
Copy link
Contributor

@sigmaSd sigmaSd commented Dec 4, 2022

No description provided.

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Dec 4, 2022

The deno std join doesn't join absolute path with common prefix correctly, I think rust one is more intuitive
Do you think Deno join should be changed ?

Copy link
Owner

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a few small comments.

src/commands/cp_mv.ts Outdated Show resolved Hide resolved
mod.test.ts Outdated Show resolved Hide resolved
mod.test.ts Outdated Show resolved Hide resolved
mod.test.ts Outdated Show resolved Hide resolved
src/common.ts Outdated Show resolved Hide resolved
src/common.ts Show resolved Hide resolved
src/common.ts Outdated
rustjoin("/a/b","/a/c") => "/a/b/c"

instead of:
Deno.path.join("/a/b","/a/c") => "/a/b/a/c"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ummm... weird. Seems like Deno is copying what node does with fs.path.

// They only exists to give better error messages.
if (await isDir(from.path)) {
if (flags.recursive) {
if (await fs.exists(to.path) && await isFile(to.path)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of calling fs.exists here, we could just call Deno.lstat once.

src/commands/cp_mv.ts Outdated Show resolved Hide resolved
src/commands/cp_mv.ts Outdated Show resolved Hide resolved
@dsherret
Copy link
Owner

dsherret commented Dec 4, 2022

I have to head out soon, so I'll probably look at this more later tonight or tomorrow. Thanks a lot for all the PRs!

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Dec 4, 2022

Sure thanks as well!

@dsherret
Copy link
Owner

dsherret commented Dec 7, 2022

I'm updating this PR just now with main. Give me a few minutes....

@dsherret dsherret merged commit 760f04d into dsherret:main Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants