Skip to content

Commit

Permalink
update cwt to address single script bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jspies committed Feb 27, 2019
1 parent 4122fe1 commit 76f347b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 9 additions & 2 deletions deploy/lib/singlescript.js
Expand Up @@ -50,6 +50,12 @@ module.exports = {
})
},

/**
* Deploys a single script zone which can only have one script per zone.
* Because of this the name field is omitted.
* Also, zoneId must be used since it is required to deploy a single script.
* @param {*} functionObject
*/
async deploySingleScript(functionObject) {
return await BB.bind(this).then(async () => {
const { zoneId } = this.provider.config;
Expand All @@ -66,12 +72,13 @@ module.exports = {

cf.setAccountId(this.provider.config.accountId);
let bindings = await ms.getBindings(this.provider, functionObject)

const response = await cf.workers.deploy({
accountId: this.provider.config.accountId,
zoneId: this.provider.config.zoneId,
zoneId,
script: scriptContents,
bindings
})
});

workerScriptResponse = response;

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "serverless-cloudflare-workers",
"version": "1.0.9",
"version": "1.0.10",
"description": "serverless cloudflare workers ",
"main": "index.js",
"scripts": {
Expand All @@ -22,7 +22,7 @@
],
"dependencies": {
"bluebird": "^3.4.7",
"cloudflare-workers-toolkit": "0.0.10",
"cloudflare-workers-toolkit": "0.0.11",
"fs-extra": "^7.0.1",
"node-fetch": "^2.3.0",
"webpack": "^4.25.1"
Expand Down

0 comments on commit 76f347b

Please sign in to comment.