[now-cli] Add error message when running now dev on an unlinked folder (#3692)

* refactor getLinkedProject

* adjustments

* refactor getLinkedOrg

* refactor linkFolderToProject to skip linking

* fix dev tests

* adjust tests

* print deployment url for files

* fix missing `NOW_PROJECT_ID` check

* `process.status` -> `link.status`
This commit is contained in:
Luc
2020-01-29 21:09:08 +01:00
committed by GitHub
parent 6f7069aadd
commit fbf659e4e1
8 changed files with 139 additions and 98 deletions

View File

@@ -109,6 +109,7 @@ function validateResponseHeaders(t, res) {
async function exec(directory, args = []) {
return execa(binaryPath, ['dev', directory, ...args], {
reject: false,
env: { __NOW_SKIP_DEV_COMMAND: 1 },
});
}
@@ -161,6 +162,7 @@ async function testFixture(directory, opts = {}, args = []) {
detached: true,
stdio: 'pipe',
...opts,
env: { ...opts.env, __NOW_SKIP_DEV_COMMAND: 1 },
}
);
@@ -223,7 +225,9 @@ function testFixtureStdio(directory, fn) {
let stderr = '';
let printedOutput = false;
dev = execa(binaryPath, ['dev', dir, '-l', port]);
dev = execa(binaryPath, ['dev', dir, '-l', port], {
env: { __NOW_SKIP_DEV_COMMAND: 1 },
});
dev.stdout.on('data', data => {
stdoutList.push(data);