Fix the broken xcode detection due to space

Summary: Due to the space in the path, `fs.pathExists` returned false even if the path was existent. Thus added `.trim()` to fix it.

Reviewed By: passy

Differential Revision: D26869404

fbshipit-source-id: 146a96262353177e786f5100a1dad9af7c7d398b
This commit is contained in:
Pritesh Nandgaonkar
2021-03-08 04:57:31 -08:00
committed by Facebook GitHub Bot
parent 7e884cba26
commit 226e042e1d

View File

@@ -262,7 +262,7 @@ function wrapWithErrorMessage<T>(p: Promise<T>): Promise<T> {
async function isXcodeDetected(): Promise<boolean> { async function isXcodeDetected(): Promise<boolean> {
return exec('xcode-select -p') return exec('xcode-select -p')
.then(({stdout}) => { .then(({stdout}) => {
return fs.pathExists(stdout); return fs.pathExists(stdout.trim());
}) })
.catch((_) => false); .catch((_) => false);
} }