Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Running ml from Roxy dir returns error instead of usage #210

Closed
grtjn opened this issue Apr 22, 2014 · 10 comments
Closed

Running ml from Roxy dir returns error instead of usage #210

grtjn opened this issue Apr 22, 2014 · 10 comments
Milestone

Comments

@grtjn
Copy link
Contributor

grtjn commented Apr 22, 2014

Running ./ml directly from roxy root dir returns:

ERROR: You must run ml init to configure your application.

instead of the 'new' usage..

@dmcassel
Copy link
Collaborator

I think the "you must run init" message is appropriate. If we were going to change that, I don't think the change could be based on the name of the directory. I've got Roxy in lots of different directories.

@grtjn
Copy link
Contributor Author

grtjn commented Apr 22, 2014

It is at least an attempt to prevent ourselves from polluting the Roxy development folder. I'm certain I'm going to blindly run ./ml init at some point, and not being sure how that will going to break the roxy git project (or any change I might have added there)..

@grtjn
Copy link
Contributor Author

grtjn commented Apr 22, 2014

I admit it is fragile, though. Better ideas welcome..

@dmcassel
Copy link
Collaborator

If you run "ml init" in a Roxy project directory that has already been initialized, Roxy will error out when it sees that deploy/ml-config.xml already exists. You then have the option to force it to overwrite the existing files. If you do that, you still wouldn't affect the Roxy git project unless you both check in your changes and push them, and your changes went to this repo (instead of to a fork).

If you're worried that after cloning Roxy, you might accidentally use that copy for a separate project based on Roxy, ... don't do that. :) To use Roxy for projects, all you need is the ml script in your path. I do keep a copy of the Roxy project itself for use when I'm working on Roxy itself, but I find that pretty simple to keep clear. I guess I'm not seeing a problem here.

@grtjn
Copy link
Contributor Author

grtjn commented Apr 22, 2014

I am talking about running ./ml from within the folder that contains the git clone of Roxy for developing on Roxy itself. For instance to run self-test, working on improving usage/help, etc..

@grtjn
Copy link
Contributor Author

grtjn commented Apr 22, 2014

I have pushed some changes to grtjn/roxy dev branch that (attempt to) make it show the usage of 'new' if you don't provide params, or just -h or --help..

@grtjn
Copy link
Contributor Author

grtjn commented Apr 25, 2014

Rethinking this issue. So, doing ml or ml -h from a roxy folder created with ml new works just fine. It is only in case you git clone roxy directly yourself (for development), and run ml or ml -h from there (maybe to look how to run its internal unit tests) it gives the above mentioned "run ml init" error message. The issues I have with that are:

  • it is odd to have to 'init' before you can ask for usage/help
  • actually doing ml init on a bare git clone of roxy, to get access to the usage/help, messes up the development copy of roxy

The first would a simple fix. Just check for empty args or a single -h/--help arg at the beginning of ml.rb, and simply show usage in that case.

The second is harder. You need to detect a roxy clone first. That is possible with the help of git config --get remote.origin.url. If that returns a string ending with '/roxy.git' or '/roxy/', that means you are in a roxy clone. The init command could then show a warning, ask confirmation, or just abort.

@dmcassel
Copy link
Collaborator

I agree that you should be able to get help without initializing a project, that makes sense.

I actually do "ml init" on my development copy all the time, because I need a project to work with to add and test a feature. I just don't check in the generated files. We could just add those the .gitignore, on the assumption that you'll only get that file if you clone Roxy, whereas it will be removed if you run "new".

@grtjn
Copy link
Contributor Author

grtjn commented Apr 25, 2014

Good to know that ml init isn't that harmful for the development copy. I'll take a look at a .gitignore solution for that, and perhaps open a new issue for that..

@paxtonhare
Copy link
Contributor

fixed in dev

@paxtonhare paxtonhare modified the milestone: v1.6 Oct 31, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants