Skip to content

Commit

Permalink
Fix getting apps in the local app directory
Browse files Browse the repository at this point in the history
Fixes #5
Closes #6
  • Loading branch information
sindresorhus committed May 19, 2021
1 parent 685e1bb commit 43941f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import {homedir} from 'os';
import path from 'path';
import {promisify} from 'util';
import {execFile} from 'child_process';

const execFileP = promisify(execFile);

export default async function appExists(nameOrBundleId) {
const isBundleId = nameOrBundleId.includes('.');

const paths = [
'/Applications',
'~/Applications'
path.join(homedir(), 'Applications')
];

const pathArgs = paths.flatMap(path => ['-onlyin', path]);

const query = isBundleId ?
Expand Down

0 comments on commit 43941f7

Please sign in to comment.