From 18db250854ebb632dbe0c892fee8c40654def900 Mon Sep 17 00:00:00 2001 From: pengbo43 Date: Mon, 14 Nov 2022 15:36:32 +0800 Subject: [PATCH] fix: get the first app --- src/utils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index e7c8b33..e689612 100644 --- a/src/utils.js +++ b/src/utils.js @@ -54,7 +54,9 @@ const findDarwinApplication = id => { log('trace', 'findDarwinApplication', id); const command = `mdfind "kMDItemCFBundleIdentifier=='${id}'"`; log('trace', command); - return run(command).then(v => v.replace(/(\s)/g, '\\ ')); + return run(command).then(v => { + return v.split('\n')[0].replace(/(\s)/g, '\\ '); + }); }; const generatePlistBuddyCommand = (appPath, options) => {