Skip to content

Commit

Permalink
refactor: this is cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
c-ehrlich committed Sep 25, 2022
1 parent 977be8f commit 9e02acf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cli/src/installers/nextAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export const nextAuthInstaller: Installer = async ({
}) => {
await runPkgManagerInstall({
packages: [
"next-auth",
// FIXME: temp fix for `next-auth@^4.11` requiring `next@12.2.5` as a peer dependency
"next-auth@~4.10.3",
packages?.prisma.inUse ? "@next-auth/prisma-adapter" : "",
],
});
Expand Down
7 changes: 1 addition & 6 deletions cli/src/utils/runPkgManagerInstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,10 @@ export const runPkgManagerInstall = async (
return;
}

// FIXME: temp fix for `next-auth@^4.11` requiring `next@12.2.5` as a peer dependency
const installPackages = packages.map((pkg) =>
pkg === "next-auth" ? "next-auth@~4.10.3" : pkg,
);

const installCmd =
pkgManager === "yarn" ? `${pkgManager} add` : `${pkgManager} install`;
const flag = devMode ? "-D" : "";
const fullCmd = `${installCmd} ${flag} ${installPackages.join(" ")}`;
const fullCmd = `${installCmd} ${flag} ${packages.join(" ")}`;
await execa(fullCmd, { cwd: projectDir });
};

Expand Down

0 comments on commit 9e02acf

Please sign in to comment.