jide / clamp

Command Line Apache MySQL PHP
http://jide.github.io/clamp
GNU General Public License v2.0
79 stars 9 forks source link

don't hardcode /usr/local/clamp path #32

Closed aerickson closed 5 years ago

aerickson commented 5 years ago

Hardcoding /usr/local/clamp makes development difficult and is unnecessary.

Tested by installing my homebrew tap (https://github.com/aerickson/homebrew-clamp) that uses my fork with this code.

The find/replace in homebrew-clamp needs to be removed if/when this change is landed.

rqelibari commented 5 years ago

Hi @aerickson, thank you for your contribution. It is actually quite a good idea to not hardcode the path (e.g. some might have their Homebrew bin directory somewhere else)! I will test your version quickly tomorrow and merge it tomorrow (GMT+1) too, if no errors occur.

rqelibari commented 5 years ago

Hi @aerickson, realpath is not installed on most macOS systems. Using it would mean to extend the dependencies of clamp for something that would not even be a feature. What was wrong with your first approach?

aerickson commented 5 years ago

Sorry about that. I thought homebrew prefixed coreutils with 'g', but apparently not.

I had issues with symlinks once clamp was installed with homebrew with the first commit. I'll investigate another solution.

rqelibari commented 5 years ago

Thank you very much! Just ping me, when I can test the code again. I will be back in couple of hours.

aerickson commented 5 years ago

OK, I found ways to do it in bash and via python. Python looks nicer and it's on every version of OS X I think, but it is an additional dependency. The bash way isn't that ugly.

Let me know your preference. Thanks. :)

rqelibari commented 5 years ago

Nice work @aerickson! I think we can safely depend on Python 2 (which is preinstalled on macOS or Mac OSX). It is concise and does what it should. Can you change that, so I can merge it.