forked from t3-oss/create-t3-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): make loader async to make it spin (t3-oss#611)
- Loading branch information
Showing
6 changed files
with
33 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-t3-app": patch | ||
--- | ||
|
||
fix(cli): make `installDependencies` step async to make loader spin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import { execSync } from "child_process"; | ||
import { execa } from "execa"; | ||
import ora from "ora"; | ||
import { getUserPkgManager } from "~/utils/getUserPkgManager.js"; | ||
import { logger } from "~/utils/logger.js"; | ||
|
||
export const installDependencies = (projectDir: string) => { | ||
export const installDependencies = async (projectDir: string) => { | ||
logger.info("Installing dependencies..."); | ||
const pkgManager = getUserPkgManager(); | ||
const command = `${pkgManager} install`; | ||
const spinner = ora(`Running ${command}...\n`).start(); | ||
const spinner = ora(`Running ${pkgManager} install...\n`).start(); | ||
|
||
execSync(command, { cwd: projectDir }); | ||
await execa(pkgManager, ["install"], { cwd: projectDir }); | ||
|
||
spinner.succeed("Successfully installed dependencies!\n"); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.