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

Commit 245f66d

Browse files
authored
1.0.0-beta.3 (#192)
1 parent 54ce914 commit 245f66d

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
##### 1.0.0-beta.3 - 23 February 2017
2+
3+
###### Bug fixes
4+
- Fixed missing promise
5+
- Fixed default `source` value in Controller#deploy
6+
- Fixed outdated discovery doc
7+
18
##### 1.0.0-beta.2 - 20 February 2017
29

310
###### Other

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@google-cloud/functions-emulator",
33
"description": "Google Cloud Functions Emulator",
4-
"version": "1.0.0-beta.2",
4+
"version": "1.0.0-beta.3",
55
"license": "Apache-2.0",
66
"author": "Google Inc.",
77
"engines": {

src/cli/controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ class Controller {
287287
cloudfunction.entryPoint = opts.entryPoint;
288288
}
289289

290+
if (!opts.source) {
291+
opts.source = process.cwd();
292+
}
293+
290294
if (opts.source.startsWith('https://')) {
291295
throw new Error('"https://" source is not supported yet!');
292296
} else if (opts.source.startsWith('gs://')) {

src/service/rest-service.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,20 @@ class RestService extends Service {
204204
});
205205
}
206206

207+
/**
208+
* Generates an upload URL.
209+
*
210+
* @param {object} req The request.
211+
* @param {object} res The response.
212+
*/
207213
generateUploadUrl (req, res) {
208214
logger.debug('RestService#generateUploadUrl');
209-
res.send({
210-
uploadUrl: CloudFunction.generateUploadUrl(this.config)
211-
}).end();
215+
return new Promise((resolve) => {
216+
res.send({
217+
uploadUrl: CloudFunction.generateUploadUrl(this.config)
218+
}).end();
219+
resolve();
220+
});
212221
}
213222

214223
/**
@@ -221,7 +230,7 @@ class RestService extends Service {
221230
return Promise.resolve()
222231
.then(() => {
223232
const doc = this._discovery.all;
224-
if (typeof doc === 'object' && Object.keys(doc).length > 0) {
233+
if (typeof doc === 'object' && Object.keys(doc).length > 0 && doc.version === API_VERSION) {
225234
return doc;
226235
}
227236
return got(DISCOVERY_URL, {

0 commit comments

Comments
 (0)