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

Commit 5f6d81b

Browse files
author
sw-yx
committed
add tiny warning if no site ID on netlify dev:exec
1 parent 4a9aa39 commit 5f6d81b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/commands/dev/exec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const execa = require("execa");
22
const Command = require("@netlify/cli-utils");
33
const { track } = require("@netlify/cli-utils/src/utils/telemetry");
4+
const chalk = require("chalk");
5+
const NETLIFYDEV = `[${chalk.cyan("Netlify Dev")}]`;
46

57
class ExecCommand extends Command {
68
async run() {
@@ -9,6 +11,10 @@ class ExecCommand extends Command {
911
const accessToken = await this.authenticate();
1012
const { addEnvVariables } = require("../../utils/dev");
1113
await addEnvVariables(api, site, accessToken);
14+
} else {
15+
console.log(
16+
`${NETLIFYDEV} No Site ID detected. You probably forgot to run \`netlify link\` or \`netlify init\`. `
17+
);
1218
}
1319
execa(this.argv[0], this.argv.slice(1), {
1420
env: process.env,

0 commit comments

Comments
 (0)