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

remote directory edit support #64

Open
alan-w-255 opened this issue Nov 14, 2017 · 7 comments
Open

remote directory edit support #64

alan-w-255 opened this issue Nov 14, 2017 · 7 comments
Labels

Comments

@alan-w-255
Copy link

it will be awesome if it supports remote directory editing

@Oxicode
Copy link

Oxicode commented Dec 5, 2017

+1

@aurora aurora added the feature label Jan 4, 2018
@aurora
Copy link
Owner

aurora commented Jan 6, 2018

I decided to work on a patch for this, see also: #44 (comment). A question regarding this, also to @KES777: should this work in a recursive way, so if there are subdirectories in the folder, should the files of the subdirectories be opened as well?

@KES777
Copy link
Contributor

KES777 commented Jan 6, 2018

I think we can control subdirectories with some sort of option: -r. like rm -r etc commands have

@aurora
Copy link
Owner

aurora commented Jan 9, 2018

I've created a branch for this feature: https://github.com/aurora/rmate/tree/issue-64, please have a look, but keep in mind, that i didn't test it thoroughly, backup your files before testing!

By default recursion is deactivated, but you can enable it by specifying the -r argument (eg.: rmate -r folder. I've also added a hard-limit which applies to all files (directly specified on commandline as well as files found in (sub)directories), which is currently set to 20. That means: rmate will not open more than 20 files. I've added this limit to prevent issues when you by accident specify a directory with thousands of files (eg.: directories with .git folder inside).

What do you think?

Thinking about all the trouble this feature could cause i feel again very unhappy about it and in my opinion it's not really the UNIX way to do things. You would have so many more possibilities by just combining rmate with for example find, eg.:

Open all php files in a directory (recursive):

find folder -name "*.php" -print0 | xargs -0 rmate

Open all php files in a directory (non-recursive):

find folder -maxdepth 1 -name "*.php" -print0 | xargs -0 rmate

etc.

You would have so many more control over what you really would like to open by combining standard UNIX tools and rmate. Maybe it's just a documentation issue ...

@KES777
Copy link
Contributor

KES777 commented Jan 10, 2018

directories with .git folder inside

the .git directory maybe added to exclude list by default. (maybe it will be better to exclude any hidden file .*)

@KES777
Copy link
Contributor

KES777 commented Jan 10, 2018

Maybe it's just a documentation issue

Maybe just shortcuts. For example:

rmate folder/*.php

will translate into:

find folder -maxdepth 1 -name "*.php" -print0 | xargs -0 rmate

@aurora
Copy link
Owner

aurora commented Jan 10, 2018

The latter is already possible, it's called parameter expansion (globbing) and done by the shell automatically, so executing rmate *.php already does what you would expect it to do. No need for any modifications to rmate. Mmmm ... i'll think about excluding predefined folders ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants