[all] Check for VERCEL_ environment variables with getPlatformEnv() (#4274)

Added the following env vars, most are undocumented but its good to be consistent:

- `VERCEL_REGION`
- `VERCEL_DEBUG`
- `VERCEL_BUILDER_DEBUG`
- `VERCEL_TOKEN`
- `__VERCEL_SKIP_DEV_CMD`

I also updated the error code prefixes to remove `NOW_`.
There `code` isn't used anywhere, this is just to make it unique and a little shorter.
This commit is contained in:
Steven
2020-05-06 18:13:12 -04:00
committed by GitHub
parent 639a9b03d2
commit ba25004ea8
25 changed files with 85 additions and 77 deletions

View File

@@ -104,7 +104,7 @@ async function exec(directory, args = []) {
return execa(binaryPath, ['dev', directory, ...args], {
reject: false,
shell: true,
env: { __NOW_SKIP_DEV_COMMAND: 1 },
env: { __VERCEL_SKIP_DEV_CMD: 1 },
});
}
@@ -180,7 +180,7 @@ async function testFixture(directory, opts = {}, args = []) {
shell: true,
stdio: 'pipe',
...opts,
env: { ...opts.env, __NOW_SKIP_DEV_COMMAND: 1 },
env: { ...opts.env, __VERCEL_SKIP_DEV_CMD: 1 },
}
);
@@ -287,7 +287,7 @@ function testFixtureStdio(
let printedOutput = false;
const env = skipDeploy
? { ...process.env, __NOW_SKIP_DEV_COMMAND: 1 }
? { ...process.env, __VERCEL_SKIP_DEV_CMD: 1 }
: process.env;
dev = execa(
binaryPath,