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 rm command #29

Merged
merged 9 commits into from
Dec 3, 2022
Merged

feat: add rm command #29

merged 9 commits into from
Dec 3, 2022

Conversation

sigmaSd
Copy link
Contributor

@sigmaSd sigmaSd commented Dec 2, 2022

I'm not sure how to fix the formatting I tried to use dprint --config but it still the same thing

Deno.remove folds force and recursive into one option recursive, is it ok to expose only --recursive ?

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Dec 2, 2022

I noticed that there is a different algorithm for parsing here https://github.com/denoland/deno_task_shell/blob/2ade977cbe14402376b56f6c929adaf07de8b27d/src/shell/commands/args.rs#L76

Is it better to try to faithufull port [rust remove command](https://github.com/denoland/deno_task_shell/blob/2ade977cbe14402376b56f6c929adaf07de8b27d/src/shell/commands/rm.rs ? (which I just noticed xD)

@sigmaSd
Copy link
Contributor Author

sigmaSd commented Dec 2, 2022

Ok I ended up porting the rust code

These questions remain though

I'm not sure how to fix the formatting I tried to use dprint --config but it still the same thing
Deno.remove folds force and recursive into one option recursive, is it ok to expose only --recursive ?

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.

LGTM. Thanks @sigmaSd! I didn't bother adding these previously because it's trivial to just call Deno.remove, however this is nice to have as a cross platform command for porting code from shell scripts to a deno script.

I'm not sure how to fix the formatting I tried to use dprint --config but it still the same thing

The command is dprint fmt. I reverted some of the other random formatting changes by using git.

Deno.remove folds force and recursive into one option recursive, is it ok to expose only --recursive ?

That's fine. We can improve it later.

@dsherret dsherret changed the title Add remove command feat: add rm command Dec 2, 2022
@dsherret dsherret merged commit 837c660 into dsherret:main Dec 3, 2022
@sigmaSd
Copy link
Contributor Author

sigmaSd commented Dec 3, 2022

Thanks for picking up the pr @dsherret

Do you think is there a way to avoid duplication between this and the rust crate ? I understand wasm can't do IO (without something like wasi) but what about parsing, maybe in this example instead of porting parse_remove_argumens, I should wasm export it ?

@sigmaSd sigmaSd deleted the rm branch December 3, 2022 06:50
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.

2 participants