Skip to content

Commit 8eda5c8

Browse files
deadcoder0904brentvatne
authored andcommitted
Support 'pnpm' (expo#412)
* Support 'pnpm' 😄 * Changed double-quote back to single-quote * Formatted back to original * Formatted back to original * Removed duplicate code & added newline
1 parent 7402574 commit 8eda5c8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

create-react-native-app/src/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,11 @@ function userHasYarn() {
5959
// then it executes '(yarn) add' command instead of '(npm) install'.
6060
function packageManagerType() {
6161
const defaultType = 'npm';
62-
const supportedTypes = ['yarn', 'npm'];
62+
const supportedTypes = ['yarn', 'npm', 'pnpm'];
6363

6464
if (packageManager) {
65-
let t = supportedTypes.find(type => {
66-
return packageManager.indexOf(type) > -1;
67-
});
68-
return t ? t : defaultType;
65+
let index = supportedTypes.indexOf(packageManager);
66+
return index === -1 ? defaultType : supportedTypes[index];
6967
}
7068

7169
return userHasYarn() ? 'yarn' : defaultType;

0 commit comments

Comments
 (0)