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

Commit 69bf5f4

Browse files
author
sw-yx
committed
minor bug with function.call()
1 parent d5b6b9e commit 69bf5f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/functions/create.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class FunctionsCreateCommand extends Command {
2020
async run() {
2121
const { flags, args } = this.parse(FunctionsCreateCommand)
2222
const { config } = this.netlify
23-
const functionsDir = ensureFunctionDirExists.call(flags, config)
23+
const functionsDir = ensureFunctionDirExists.call(this, flags, config)
2424

2525
/* either download from URL or scaffold from template */
2626
if (flags.url) {
@@ -198,7 +198,9 @@ async function downloadFromURL(flags, args, functionsDir) {
198198
const dest = fs.createWriteStream(path.join(fnFolder, finalName))
199199
res.body.pipe(dest)
200200
})
201-
.catch(err => console.error(err) || throw new Error('Error while retrieving ' + download_url))
201+
.catch(err => {
202+
throw new Error('Error while retrieving ' + download_url)
203+
})
202204
})
203205
)
204206

0 commit comments

Comments
 (0)