carrot / ship

⛔️ currently unmaintained ⛔️
Other
151 stars 14 forks source link

Lookup Netlify site by id instead of iterating over all the users sites #67

Closed biilmann closed 9 years ago

biilmann commented 9 years ago

This improves the Netlify deployer.

Right now the deployer fetches all the users sites and iterates over them to find the one matching the name in the config.

This commit changes that to lookup the site by name + ".netlify.com".

This fixes the deployer for users trying to deploy to an existing site they have access to but that they don't own.

hhsnopek commented 9 years ago

awesome! :+1:

jescalan commented 9 years ago

Thanks! This is great, Just out of curiosity, does this also work for sites with custom domains?

biilmann commented 9 years ago

Yeah, Netlify's API always lets you look up sites by either the Netlify domain, the custom domain or the site ID.

So this will also work after you assign a custom domain to a site, as long as the name of the site doesn't change.

jescalan commented 9 years ago

Awesome, I'll have this out shortly then. Thanks again! :grinning: