{"action":"created","issue":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2790","repository_url":"https://api.github.com/repos/wp-cli/wp-cli","labels_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2790/labels{/name}","comments_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2790/comments","events_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2790/events","html_url":"https://github.com/wp-cli/wp-cli/issues/2790","id":155779758,"number":2790,"title":"Erroneous behavior of \"theme\" command","user":{"login":"ivandotv","id":390700,"avatar_url":"https://avatars.githubusercontent.com/u/390700?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandotv","html_url":"https://github.com/ivandotv","followers_url":"https://api.github.com/users/ivandotv/followers","following_url":"https://api.github.com/users/ivandotv/following{/other_user}","gists_url":"https://api.github.com/users/ivandotv/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandotv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandotv/subscriptions","organizations_url":"https://api.github.com/users/ivandotv/orgs","repos_url":"https://api.github.com/users/ivandotv/repos","events_url":"https://api.github.com/users/ivandotv/events{/privacy}","received_events_url":"https://api.github.com/users/ivandotv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wp-cli/wp-cli/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/wp-cli/wp-cli/labels/command:theme","name":"command:theme","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-05-19T16:27:36Z","updated_at":"2016-05-19T17:19:35Z","closed_at":null,"body":"Scenario:\r\nIf for some reason i have a **empty** directory inside the `themes` folder in wordpress installation with the name of the theme ( e.q. 'myth').\r\nIf I query if the theme is installed, I will get a **positive** answer. \r\nIf I query the status of the theme, i will get this:\r\n````\r\n    Name: myth\r\n    Status: Inactive\r\n    Version: \r\n    Author: \r\n````\r\nIf I query the listing of the themes. Theme won't be in the list.\r\n\r\nSo basically `wp-cli` thinks just becase there is a folder with the name of the theme present, the theme is installed. \r\nSo if I try to install the theme via `wp-cli` I get `Warning: myth: Theme already installed.`\r\n\r\nYou might ask why do I have a empty directory with the name of the theme.\r\nIt's because I'm using docker for development , and I need to \"mount\" that folder before launching the container.\r\nI'm mounting an empty folder, and then the container (via wp-cli) installs all the plugins and themes I need."},"comment":{"url":"https://api.github.com/repos/wp-cli/wp-cli/issues/comments/220392758","html_url":"https://github.com/wp-cli/wp-cli/issues/2790#issuecomment-220392758","issue_url":"https://api.github.com/repos/wp-cli/wp-cli/issues/2790","id":220392758,"user":{"login":"danielbachhuber","id":36432,"avatar_url":"https://avatars.githubusercontent.com/u/36432?v=3","gravatar_id":"","url":"https://api.github.com/users/danielbachhuber","html_url":"https://github.com/danielbachhuber","followers_url":"https://api.github.com/users/danielbachhuber/followers","following_url":"https://api.github.com/users/danielbachhuber/following{/other_user}","gists_url":"https://api.github.com/users/danielbachhuber/gists{/gist_id}","starred_url":"https://api.github.com/users/danielbachhuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielbachhuber/subscriptions","organizations_url":"https://api.github.com/users/danielbachhuber/orgs","repos_url":"https://api.github.com/users/danielbachhuber/repos","events_url":"https://api.github.com/users/danielbachhuber/events{/privacy}","received_events_url":"https://api.github.com/users/danielbachhuber/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T17:19:35Z","updated_at":"2016-05-19T17:19:35Z","body":"Ok. We can add some logic to verify the theme is valid before listing it or permitting it to be activated."}}