Skip to content

Commit

Permalink
Merge pull request #1 from taras/master
Browse files Browse the repository at this point in the history
Made credentials and projectId optional
  • Loading branch information
Ilya Radchenko committed May 19, 2016
2 parents 4cd87f1 + afa9f17 commit 2882cf9
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 2882cf9

Please sign in to comment.