{"action":"opened","issue":{"url":"https://api.github.com/repos/TryGhost/gscan/issues/2","labels_url":"https://api.github.com/repos/TryGhost/gscan/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/TryGhost/gscan/issues/2/comments","events_url":"https://api.github.com/repos/TryGhost/gscan/issues/2/events","html_url":"https://github.com/TryGhost/gscan/issues/2","id":130027290,"number":2,"title":"Use `npm show ghost` to fetch the latest Ghost version","user":{"login":"ErisDS","id":101513,"avatar_url":"https://avatars.githubusercontent.com/u/101513?v=3","gravatar_id":"","url":"https://api.github.com/users/ErisDS","html_url":"https://github.com/ErisDS","followers_url":"https://api.github.com/users/ErisDS/followers","following_url":"https://api.github.com/users/ErisDS/following{/other_user}","gists_url":"https://api.github.com/users/ErisDS/gists{/gist_id}","starred_url":"https://api.github.com/users/ErisDS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ErisDS/subscriptions","organizations_url":"https://api.github.com/users/ErisDS/orgs","repos_url":"https://api.github.com/users/ErisDS/repos","events_url":"https://api.github.com/users/ErisDS/events{/privacy}","received_events_url":"https://api.github.com/users/ErisDS/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TryGhost/gscan/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-30T19:30:04Z","updated_at":"2016-01-30T19:30:04Z","closed_at":null,"body":"Several places in gscan uses the latest Ghost version, and currently it's hardcoded.\r\n\r\nThe point of this issue is to fetch this value dynamically to use in all the places where `0.7.5` is currently hard coded, but not every time `gscan` is called on the CLI or a zip is provided to the web interface as this is unnecessary overhead.\r\n\r\nIt should be possible to fetch the latest version by performing a call to `npm show ghost`.\r\n\r\nThe interesting part of this is deciding when to make the call, and how to keep the value cached for a while (maybe an hour?) even for the cli. I *think* it'd be sane to fetch it and store it to a file so that it doesn't have to be fetched for every cli call. There's probably a node module out there that does caching values to a file, with a TTL. "}}