Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 20c0b3b

Browse files
committed
fix(deploy): don't hang when there are no files to deploy
1 parent 5565004 commit 20c0b3b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/deploy/index.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,19 @@ module.exports = async (api, siteId, dir, opts) => {
5252
hashFns(fnDir, opts)
5353
])
5454

55+
const filesCount = Object.keys(files).length
56+
const functionsCount = Object.keys(functions).length
57+
5558
statusCb({
5659
type: 'hashing',
57-
msg:
58-
`Finished hashing ${Object.keys(files).length} files` +
59-
(fnDir ? ` and ${Object.keys(functions).length} functions` : ''),
60+
msg: `Finished hashing ${filesCount} files` + (fnDir ? ` and ${functionsCount} functions` : ''),
6061
phase: 'stop'
6162
})
6263

64+
if (filesCount === 0 && functionsCount === 0) {
65+
throw new Error('No files or functions to deploy')
66+
}
67+
6368
statusCb({
6469
type: 'create-deploy',
6570
msg: 'CDN diffing files...',

0 commit comments

Comments
 (0)