{"action":"opened","issue":{"url":"https://api.github.com/repos/zigg/brewdo/issues/13","labels_url":"https://api.github.com/repos/zigg/brewdo/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/zigg/brewdo/issues/13/comments","events_url":"https://api.github.com/repos/zigg/brewdo/issues/13/events","html_url":"https://github.com/zigg/brewdo/issues/13","id":112365269,"number":13,"title":"Switch/installation fails","user":{"login":"michaellopez","id":487039,"avatar_url":"https://avatars.githubusercontent.com/u/487039?v=3","gravatar_id":"","url":"https://api.github.com/users/michaellopez","html_url":"https://github.com/michaellopez","followers_url":"https://api.github.com/users/michaellopez/followers","following_url":"https://api.github.com/users/michaellopez/following{/other_user}","gists_url":"https://api.github.com/users/michaellopez/gists{/gist_id}","starred_url":"https://api.github.com/users/michaellopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaellopez/subscriptions","organizations_url":"https://api.github.com/users/michaellopez/orgs","repos_url":"https://api.github.com/users/michaellopez/repos","events_url":"https://api.github.com/users/michaellopez/events{/privacy}","received_events_url":"https://api.github.com/users/michaellopez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-20T13:11:00Z","updated_at":"2015-10-20T13:11:00Z","closed_at":null,"body":"I had an installation of Homebrew already in `/usr/local`.\r\n\r\nRan `sudo ./brewdo switch` inside my clone of [zigg/brewdo](https://github.com/zigg/brewdo). It gave me an error that `/Library/Caches/Homebrew/Formula` does not exist.\r\n\r\n```sh\r\n$ sudo ./brewdo switch\r\n./brewdo:325:in `stat': No such file or directory - /Library/Caches/Homebrew/Formula (Errno::ENOENT)\r\n\tfrom ./brewdo:325:in `file_owner'\r\n\tfrom ./brewdo:335:in `switch_owners'\r\n\tfrom ./brewdo:361:in `cmd_migrate'\r\n\tfrom ./brewdo:298:in `cmd_switch'\r\n\tfrom ./brewdo:392:in `<main>'\r\n```\r\n\r\nTrying to do another switch gave me:\r\n\r\n```sh\r\n$ sudo ./brewdo switch\r\n./brewdo:129:in `cmd_adduser': owner account exists (OwnerExistsError)\r\n\tfrom ./brewdo:296:in `cmd_switch'\r\n\tfrom ./brewdo:392:in `<main>'\r\n```\r\n\r\nAfter a `sudo ./brewdo deluser` I tried to switch again:\r\n\r\n```sh\r\n./brewdo:192:in `mkdir': File exists - /var/log/homebrew (Errno::EEXIST)\r\n\tfrom ./brewdo:192:in `create_homebrew_log'\r\n\tfrom ./brewdo:275:in `cmd_mklogdir'\r\n\tfrom ./brewdo:297:in `cmd_switch'\r\n\tfrom ./brewdo:392:in `<main>'\r\n```\r\n\r\nAfter a `sudo ./brewdo deluser && rm -rf /var/log/homebrew` I managed to switch again but gave me the first error message again (understandably, I hadn't created the path).\r\n\r\nI think all the above shouldn't error out. The paths should be optional and the user account creation should be satisfied that it exists rather than throwing an error saying that it already exists.\r\n\r\nPlease don't add `HOMEBREW_CACHE` to the directories created by `cmd_mkdirs` to fix the first error message above! If it does not exist, it is still a valid and working Homebrew installation. I don't want unnecessary folders loitering on my system.\r\n\r\nWhat are your thoughts on this? @zigg "}}