Skip to content

Commit

Permalink
Made credentials and projectId optional
Browse files Browse the repository at this point in the history
  • Loading branch information
taras committed May 13, 2016
1 parent 4cd87f1 commit afa9f17
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ module.exports = {
}
},

requiredConfig: [
'credentials',
'projectId'
],

upload: function(context) {
var self = this;
var credentials = this.readConfig('credentials');
Expand All @@ -41,16 +36,21 @@ module.exports = {

this.log('uploading..');

return upload(this, {
gcloud: {
credentials: credentials,
projectId: projectId
},
var config = {
bucket: bucket,
fileBase: context.distDir,
filePaths: filesToUpload,
gzippedFilePaths: gzippedFiles
})
};

if ( projectId && credentials ) {
config['gcloud'] = {
credentials: credentials,
projectId: projectId
};
}

return upload(this, config)
.then(function (filesUploaded) {
self.log('uploaded ' + filesUploaded.length + ' files ok', { verbose: true });
return { filesUploaded: filesUploaded };
Expand Down

0 comments on commit afa9f17

Please sign in to comment.