gregwebs / Shelly.hs

Haskell shell scripting
BSD 3-Clause "New" or "Revised" License
418 stars 88 forks source link

Added followSymlink for find-command #141

Closed junjihashimoto closed 7 years ago

junjihashimoto commented 7 years ago

Hi,

Currently, find-command can not follow symlink like 'find -L'. See this code. This PR adds followSymlink-flag to follow symlinks.

junjihashimoto commented 7 years ago

Sorry for not reading https://github.com/yesodweb/Shelly.hs/issues/21. (Now I read it.)

If there is a DSL and its implementation for find-command, it will be better than this PR.

I suppose the DSL will change filter-options and search-area of file system.

In use case of changing filter-options, we can use findWhen, so we do not need additional function for shelly.

In use case of changing search-area, we can refer to linux-find-command. In this manual, the option of search-area is just whether to follow symlinks or not.

I think we need just a option of following symlinks and do not need DSL. (To solve my job, I need this option. If you have any alternative solution, please tell me.)

junjihashimoto commented 7 years ago

Any suggestions are welcome. Should I implement DSL version of symlink?

gregwebs commented 7 years ago

Thanks for the PR. I agree that something find-specific would be better, but this seems fine. Would you like me to merge it now?

junjihashimoto commented 7 years ago

I'd love to! It would be a great help. I am using my branch.

junjihashimoto commented 7 years ago

Thanks!