Browse Source

remove: delete deployment by URL (#172)

So this now works:

```
now rm https://ffitest-hcznbannyc.now.sh
```

Fixes #87.
master
Nathan Rajlich 8 years ago
committed by Olli Vanhoja
parent
commit
76e3afe88e
  1. 13
      bin/now-remove

13
bin/now-remove

@ -117,7 +117,18 @@ async function remove (token) {
const deployments = await now.list();
const matches = deployments.filter((d) => {
return ids.find((id) => d.uid === id || d.name === id);
return ids.find((id) => {
// `url` should match the hostname of the deployment
let u = id.replace(/^https\:\/\//i, '');
if (-1 === u.indexOf('.')) {
// `.now.sh` domain is implied if just the subdomain is given
u += '.now.sh';
}
return d.uid === id
|| d.name === id
|| d.url === u;
});
});
if (0 === matches.length) {

Loading…
Cancel
Save