Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit fcc03ea

Browse files
authored
Merge pull request #87 from netlify/ensureSiteIdForLiveTunnel
add warning if site is not linked when running netlify deploy live tunnel
2 parents 63c2e93 + ce606dd commit fcc03ea

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/live-tunnel.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ const { fetchLatest, updateAvailable } = require("gh-release-fetch");
88
async function createTunnel(siteId, netlifyApiToken, log) {
99
await installTunnelClient(log);
1010

11-
log("Creating Live Tunnel");
11+
if (!siteId) {
12+
console.error(
13+
"Error: no siteId defined, did you forget to run `netlify init` or `netlify link`?"
14+
);
15+
process.exit(1);
16+
}
17+
log("Creating Live Tunnel for " + siteId);
1218
const url = `https://api.netlify.com/api/v1/live_sessions?site_id=${siteId}`;
1319

1420
const response = await fetch(url, {

0 commit comments

Comments
 (0)