-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 (#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.
78a0da3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
create-t3-app – ./
create-t3-app-nu.vercel.app
create-t3-app-t3-oss.vercel.app
create-t3-app-git-next-t3-oss.vercel.app
beta.create.t3.gg