Skip to content
This repository has been archived by the owner on May 15, 2019. It is now read-only.

Commit

Permalink
1.0.0-beta.3 (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdobry authored Feb 23, 2018
1 parent 54ce914 commit 245f66d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
##### 1.0.0-beta.3 - 23 February 2017

###### Bug fixes
- Fixed missing promise
- Fixed default `source` value in Controller#deploy
- Fixed outdated discovery doc

##### 1.0.0-beta.2 - 20 February 2017

###### Other
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@google-cloud/functions-emulator",
"description": "Google Cloud Functions Emulator",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"license": "Apache-2.0",
"author": "Google Inc.",
"engines": {
Expand Down
4 changes: 4 additions & 0 deletions src/cli/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ class Controller {
cloudfunction.entryPoint = opts.entryPoint;
}

if (!opts.source) {
opts.source = process.cwd();
}

if (opts.source.startsWith('https://')) {
throw new Error('"https://" source is not supported yet!');
} else if (opts.source.startsWith('gs://')) {
Expand Down
17 changes: 13 additions & 4 deletions src/service/rest-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,20 @@ class RestService extends Service {
});
}

/**
* Generates an upload URL.
*
* @param {object} req The request.
* @param {object} res The response.
*/
generateUploadUrl (req, res) {
logger.debug('RestService#generateUploadUrl');
res.send({
uploadUrl: CloudFunction.generateUploadUrl(this.config)
}).end();
return new Promise((resolve) => {
res.send({
uploadUrl: CloudFunction.generateUploadUrl(this.config)
}).end();
resolve();
});
}

/**
Expand All @@ -221,7 +230,7 @@ class RestService extends Service {
return Promise.resolve()
.then(() => {
const doc = this._discovery.all;
if (typeof doc === 'object' && Object.keys(doc).length > 0) {
if (typeof doc === 'object' && Object.keys(doc).length > 0 && doc.version === API_VERSION) {
return doc;
}
return got(DISCOVERY_URL, {
Expand Down

0 comments on commit 245f66d

Please sign in to comment.