Since we use Greenkeeper to update dependencies for `now-cli`,
we can depend on it to keep the version of `serve` that we use
for static deployments up-to-date at all times.
* refactor the `readMetaData()` function
* add a couple new test cases
* test: restore "build" prefix
Fixes Node.js <= v6
* add default values for `npm`/`docker` get files functions
Makes the logic simpler, since we don't have to check for existence.
* throw an error when missing start/now-start or server.js
* pass in entire `readMetaData()` result to Now.create()
This avoids us reading these files from the filesystem again
```
> Error! Unknown error: TypeError: Cannot read property 'username' of undefined
TypeError: Cannot read property 'username' of undefined
at /usr/local/lib/node_modules/now/build/bin/now-deploy.js:316:115
at Generator.next (<anonymous>)
at c (/usr/local/lib/node_modules/now/build/bin/now-deploy.js:760:99)
```
Consider a tree like:
```
.
├── Dockerfile
└── now.json
0 directories, 2 files
```
Before this patch, this deployment would be considered a "static"
deployment, which is incorrect. Now it is properly detected
as a "docker" deployment type.
Is is disrupting to remove logs that are potentially
useful for diagnosing when something is going wrong
when starting up / building a deployment.
Just log stdout in its entirety to the `now` build output
with no lines being removed in the process.
As discussed with @rauchg.