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
8 changes: 6 additions & 2 deletions src/helpers/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,13 @@ export function dirPackage(pkg: PackageInterface) {
}

export function dirPlugins() {
if (getSystem() === SystemType.Win) return path.join('Program Files', 'Common Files');
if (getSystem() === SystemType.Win)
return process.env['ProgramFiles(x86)'] || path.join('C:', 'Program Files (x86)', 'Common Files');
else if (getSystem() === SystemType.Mac) return path.join(os.homedir(), 'Library', 'Audio', 'Plug-ins');
return path.join('usr', 'local', 'lib');
// Under $HOME rather than the system-wide /usr/local/lib, matching the spec - this keeps the
// default writable without elevation, consistent with the unprivileged archive-install path
// (see ManagerLocal.install()).
return path.join(os.homedir(), 'usr', 'local', 'lib');
}

export function dirPresets() {
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/file.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ test('Directory package', () => {

test('Directory plugins', () => {
if (process.platform === 'win32') {
expect(dirPlugins()).toEqual('Program Files\\Common Files');
expect(dirPlugins()).toEqual(process.env['ProgramFiles(x86)'] || 'C:\\Program Files (x86)\\Common Files');
} else if (process.platform === 'darwin') {
expect(dirPlugins()).toEqual(`${os.homedir()}/Library/Audio/Plug-ins`);
} else {
expect(dirPlugins()).toEqual('usr/local/lib');
expect(dirPlugins()).toEqual(`${os.homedir()}/usr/local/lib`);
}
});

Expand Down
Loading