{"action":"created","issue":{"url":"https://api.github.com/repos/buildinspace/peru/issues/108","labels_url":"https://api.github.com/repos/buildinspace/peru/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/buildinspace/peru/issues/108/comments","events_url":"https://api.github.com/repos/buildinspace/peru/issues/108/events","html_url":"https://github.com/buildinspace/peru/issues/108","id":60835540,"number":108,"title":"a coherent set of config variables/flags","user":{"login":"oconnor663","id":860932,"avatar_url":"https://avatars.githubusercontent.com/u/860932?v=3","gravatar_id":"","url":"https://api.github.com/users/oconnor663","html_url":"https://github.com/oconnor663","followers_url":"https://api.github.com/users/oconnor663/followers","following_url":"https://api.github.com/users/oconnor663/following{/other_user}","gists_url":"https://api.github.com/users/oconnor663/gists{/gist_id}","starred_url":"https://api.github.com/users/oconnor663/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oconnor663/subscriptions","organizations_url":"https://api.github.com/users/oconnor663/orgs","repos_url":"https://api.github.com/users/oconnor663/repos","events_url":"https://api.github.com/users/oconnor663/events{/privacy}","received_events_url":"https://api.github.com/users/oconnor663/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/buildinspace/peru/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"olson-sean-k","id":1481619,"avatar_url":"https://avatars.githubusercontent.com/u/1481619?v=3","gravatar_id":"","url":"https://api.github.com/users/olson-sean-k","html_url":"https://github.com/olson-sean-k","followers_url":"https://api.github.com/users/olson-sean-k/followers","following_url":"https://api.github.com/users/olson-sean-k/following{/other_user}","gists_url":"https://api.github.com/users/olson-sean-k/gists{/gist_id}","starred_url":"https://api.github.com/users/olson-sean-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olson-sean-k/subscriptions","organizations_url":"https://api.github.com/users/olson-sean-k/orgs","repos_url":"https://api.github.com/users/olson-sean-k/repos","events_url":"https://api.github.com/users/olson-sean-k/events{/privacy}","received_events_url":"https://api.github.com/users/olson-sean-k/received_events","type":"User","site_admin":false},"milestone":null,"comments":19,"created_at":"2015-03-12T15:19:23Z","updated_at":"2015-05-19T19:44:33Z","closed_at":null,"body":"@olson-sean-k and I had a discussion in https://phabricator.buildinspace.com/D197, and I'm just copying the result of that here, partly in case we lose the Phabricator server :)\r\n\r\nWe want to make the following configs available. Each one determines all the ones that come after it, unless those are explicitly set too.\r\n\r\n- `$PERU_FILE` `--peru-file`: The filepath to the YAML file to use, instead of searching for `peru.yaml`.\r\n- `$PERU_SYNC_DIR` `--sync-dir`: The directory where the root of the imports tree goes.\r\n- `$PERU_STATE_DIR` `--state-dir`: Where to put stuff that normally goes in the `.peru` dir.\r\n- `$PERU_CACHE_DIR` `--cache-dir`: Where to put the cache, which normally goes in `cache/` in the state dir.\r\n\r\nNote that we are *not* including a config to change the peru file search name. (We'll be getting rid of the existing `$PERU_FILE_NAME` config.) When peru searches for the file on its own -- which works even if it's somewhere above the current directory -- it will always look for \"peru.yaml\". It's hard to imagine how changing that in a global config could be useful to anyone, and if you're going to set it locally for some projects, you might as well set the full filepath explicitly.\r\n\r\nWe're also probably going to require that, if either one of `--peru-file` or `--sync-dir` are set, then both must be set. @olson-sean-k pointed out some very confusing cases that could result from allowing either one to take a default value based on the other. I've forgotten what they were, but they were bad :)"},"comment":{"url":"https://api.github.com/repos/buildinspace/peru/issues/comments/103648426","html_url":"https://github.com/buildinspace/peru/issues/108#issuecomment-103648426","issue_url":"https://api.github.com/repos/buildinspace/peru/issues/108","id":103648426,"user":{"login":"olson-sean-k","id":1481619,"avatar_url":"https://avatars.githubusercontent.com/u/1481619?v=3","gravatar_id":"","url":"https://api.github.com/users/olson-sean-k","html_url":"https://github.com/olson-sean-k","followers_url":"https://api.github.com/users/olson-sean-k/followers","following_url":"https://api.github.com/users/olson-sean-k/following{/other_user}","gists_url":"https://api.github.com/users/olson-sean-k/gists{/gist_id}","starred_url":"https://api.github.com/users/olson-sean-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olson-sean-k/subscriptions","organizations_url":"https://api.github.com/users/olson-sean-k/orgs","repos_url":"https://api.github.com/users/olson-sean-k/repos","events_url":"https://api.github.com/users/olson-sean-k/events{/privacy}","received_events_url":"https://api.github.com/users/olson-sean-k/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T19:44:33Z","updated_at":"2015-05-19T19:44:33Z","body":"I think projects should generally avoid custom names for `peru.yaml`. The issues we've seen so far involving custom names have been about cosmetic rather than functional problems, which aren't worth the potential complications in my opinion. I also agree that `peru.yaml` is analogous to `Makefile` or `setup.py`: visibility is a good thing.\r\n\r\nThat all being said, I think it's very useful to be able to configure peru to sync into an arbitrary directory using an arbitrary `peru.yaml` file. It makes peru a more general tool.\r\n\r\nSee the discussion in [D197](https://phabricator.buildinspace.com/D197). Ultimately, I think the mutually exclusive arguments discussed in that diff are a reasonable choice:\r\n\r\n```peru sync [--peru-file-name=<basename> | (--peru-file=<path> --sync-dir=<path>)]```\r\n\r\nNote that we could support only the `--peru-file` and `--sync-dir` arguments, but that doesn't prevent hacky aliases like ``peru --peru-file=`find.sh --peru-file` --sync-dir=`find.sh --sync-dir` ``, which are arguably worse than just supporting a custom name via a mutually exclusive `--peru-file-name` argument. We could also completely prevent custom names using different arguments, but that obviates some legitimate use cases, in particular those that don't involve the typical project layout."}}