This repository was archived by the owner on May 15, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed
Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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" : {
Original file line number Diff line number Diff 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://' ) ) {
Original file line number Diff line number Diff 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 , {
You can’t perform that action at this time.
0 commit comments