Skip to content
Merged
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
9 changes: 8 additions & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ export function isPlatformMac(
return platform === 'darwin' || platform === 'mas';
}

/**
* Gets the tmpdir for packaging. Note that if `opts.tmpdir` is false,
* we're still returning a path.
*/
export function baseTempDir(opts: Options) {
return path.join(opts.tmpdir || os.tmpdir(), 'electron-packager');
return path.join(
typeof opts.tmpdir === 'string' ? opts.tmpdir : os.tmpdir(),
'electron-packager',
);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,11 @@ export interface Options {
quiet?: boolean;
/**
* The base directory to use as a temporary directory. Set to `false` to disable use of a
* temporary directory. Defaults to the system's temporary directory.
* temporary directory.
*
* @defaultValue Uses the system's temporary directory if `true` or `undefined`.
*/
tmpdir?: string | false;
tmpdir?: string | boolean;
/**
* Human-readable descriptions of how the Electron app uses certain macOS features. These are displayed
* in the App Store. A non-exhaustive list of available properties:
Expand Down