Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Codesign issue when app name has spaces #238

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down
4 changes: 4 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ export async function validateOptsApp (opts: BaseSignOptions): Promise<void> {
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.`);
}
}

/**
Expand Down