AmirHmZz / mpbridge

CLI tool to synchronise and manage files on MicroPython running devices
https://pypi.org/project/mpbridge
MIT License
51 stars 5 forks source link

Feature idea: delete directory #17

Closed ThinkTransit closed 1 year ago

ThinkTransit commented 1 year ago

It would be really useful to be able to delete just one directory.

Maybe a new command or a parameter could be supplied to "clear" eg. "clear /logs"?

AmirHmZz commented 1 year ago

Thanks for the idea, In your opinion it is better to delete files inside of the directory or delete directory too?

ThinkTransit commented 1 year ago

I think it would be good to mimic the linux rm command, for example

Deletes directory

mpbridge clear dir

Deletes files in directory

mpbridge clear dir/*

I don't know how hard this would be to implement.

AmirHmZz commented 1 year ago

It's not hard at all but I'll be glad to hear @Wind-stormger opinion too about this change

Wind-stormger commented 1 year ago

I don't think we can keep reinventing the wheel any longer.

Let me be straightforward, if you must use commands, mpremote connect [RPOT] fs rmdir [remote dir] will do it.

The current method of mpbridge deleting files and folders is much simpler and easier than using commands.

Run mpbridge bridge <PORT>, delete files or folders you don't need, end.

So convenient, because it can be operated in the graphical file management interface of your operating system, this is what makes mpbridge unique, at least in my opinion.

If you can only operate in the terminal, mpremote is your best choice.

Have a nice day.

Wind-stormger commented 1 year ago

In fact, the one who reinvented the wheel was me.

mpbridge list is completely copied from mpremote connect list. #16 (this is more like copying the wheel)

I have been struggling with this for a long time, but I think that listing available devices is the most basic function that a micropython auxiliary development tool should have, even if this function comes from mpremote, and mpbridge is developed based on mpremote.

To continue reinventing, or copying the wheel, I don't think it's appropriate anymore, this is my personal opinion.

AmirHmZz commented 1 year ago

@Wind-stormger I've had the exact idea in my head and that was why I've asked your opinion. Some low level functionalities must be implemented in mpremote itself. Deleting a full directory should be nothing further and more than an empty directory. I think it is better to focus on features that mpremote is not going to have in future. So I will close this issue but feel free to open another one if you have other ideas.