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

fix(deploy): don't hang when there are no files to deploy #161

Merged
merged 1 commit into from
Sep 24, 2020

Conversation

erezrokah
Copy link
Contributor

- Summary

Related to netlify/cli#1227.
Going to follow up with a CLI matching PR.

At the moment the deploy command hangs if there are no files to deploy.
This can happen when running netlify deploy --dir public on a project with an empty public directory and no netlify.toml file (see issue above).

The state of deploy remains new so the following code hangs:

const d = await api.getSiteDeploy({ siteId, deployId })

- Test plan

Will test this in the CLI repo.

- Description for the changelog

Throw an error when deploy is called and there are no files to deploy (previously hanged).

- A picture of a cute animal (not mandatory but encouraged)

🐱

The flow can be further improved when we do #157

phase: 'stop'
})

if (filesCount <= 0 && functionsCount <= 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[sand] Since filesCount and functionsCount cannot be negative, would === be clearer than <=?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's me being probably too protective with my code.

@erezrokah erezrokah merged commit a802358 into master Sep 24, 2020
@erezrokah erezrokah deleted the fix/deploy_hang_when_no_files branch September 24, 2020 08:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants