Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
feat: ensure main file exists
Browse files Browse the repository at this point in the history
If the file doesn't exists show an error to the user.
  • Loading branch information
xtuc committed May 24, 2019
1 parent dbbfbff commit c413eed
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/commands/publish/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ impl Package {
"The `main` key in your `package.json` file is required; please specified the entrypoint of your Worker.",
)
} else {
Ok(self.main.clone())
if !Path::new(&self.main).exists() {
failure::bail!(
"The entrypoint of your Worker ({}) could not be found.",
self.main
)
} else {
Ok(self.main.clone())
}
}
}
}
Expand Down

0 comments on commit c413eed

Please sign in to comment.