Merge pull request #139 from gknapp/config-error-messages

fix(dev): Rephrase config error messages, fix typo 'electorn'
This commit is contained in:
alex.wei 2023-04-03 09:51:47 +08:00 committed by GitHub
commit 72d37a70ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,15 +11,15 @@ const ensureElectronEntryFile = (root = process.cwd()): void => {
if (fs.existsSync(pkg)) {
const main = require(pkg).main
if (!main) {
throw new Error('not found an entry point to electorn app, please add main field for your package.json')
throw new Error('No entry point found for electron app, please add a "main" field to package.json')
} else {
const entryPath = path.resolve(root, main)
if (!fs.existsSync(entryPath)) {
throw new Error(`not found the electorn app entry file: ${entryPath}`)
throw new Error(`No electron app entry file found: ${entryPath}`)
}
}
} else {
throw new Error('no package.json')
throw new Error('Not found: package.json')
}
}