diff --git a/README.md b/README.md index ca7a50c..cff44ae 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ signAsync({ `app` - *String* Path to the application package. -Needs file extension `.app`. +Needs file extension `.app`. NOTE: if your app name contains the space character, please rename the .app and the binary in `.app/Contents/MacOS/` without the space character; otherwise, it will throw an error. **Optional** diff --git a/src/util.ts b/src/util.ts index 9a7e5c4..a81afe4 100644 --- a/src/util.ts +++ b/src/util.ts @@ -107,6 +107,10 @@ export async function validateOptsApp (opts: BaseSignOptions): Promise { if (!(await fs.pathExists(opts.app))) { throw new Error(`Application at path "${opts.app}" could not be found`); } + const pathWithSpaceEscapeChars = opts.app.replace(/(\s+)/g, '\\$1'); + if (opts.app !== pathWithSpaceEscapeChars) { + throw new Error(`Application name "${opts.app}" with space is not supported.`); + } } /**