Closed eduwass closed 3 years ago
I realized the rest of the CLI isn't Linux or OS friendly, so I'm just going to merge this! Thanks!
Hi Guys, Is this ability added ? Can i start a site via site-name ?
Does not work for me.
local-cli start-site mysite
Error: Cannot read property 'id' of null: {"response":{"errors":[{"message":"Cannot read
property 'id' of
null","locations":[{"line":3,"column":9}],"path":["startSite"],"extensions":{"code":"INTERN
AL_SERVER_ERROR"}}],"data":{"startSite":null},"status":200},"request":{"query":"\n
mutation ($siteID: ID!) {\n startSite(id: $siteID) {\n id\n name\n
status\n }\n }\n ","variables":{"siteID":"mysite"}}}```
This PR adds the ability to start/stop sites by using their name in the CLI.
It'll compare the input with Local's
sites.json
file to see if there's a match by name, and return the ID if so.Also added some basic error handling when the GraphQL Request is not successful.