From 88e6e21628858b243ca7bdc9b5202e357afad386 Mon Sep 17 00:00:00 2001 From: iAverages <31937542+iAverages@users.noreply.github.com> Date: Fri, 24 Mar 2023 22:45:14 +0000 Subject: [PATCH 1/4] Replace gitbash check with mintty check --- cli/src/cli/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/src/cli/index.ts b/cli/src/cli/index.ts index d7ea8396ac..690f8ef093 100644 --- a/cli/src/cli/index.ts +++ b/cli/src/cli/index.ts @@ -157,12 +157,11 @@ export const runCli = async () => { // Explained below why this is in a try/catch block try { - if ( - process.env.SHELL?.toLowerCase().includes("git") && - process.env.SHELL?.includes("bash") - ) { - logger.warn(` WARNING: It looks like you are using Git Bash which is non-interactive. Please run create-t3-app with another + if (process.env.TERM_PROGRAM?.toLowerCase().includes("mintty")) { + logger.warn(` WARNING: It looks like you are using Mintty which is non-interactive. Please run create-t3-app with another terminal such as Windows Terminal or PowerShell if you want to use the interactive CLI.`); + logger.warn(` WARNING: If you are using Git Bash, please use Git Bash from another terminal, such as Windows Terminal + or the terminal build into Visual Studio Code.`); const error = new Error("Non-interactive environment"); // eslint-disable-next-line @typescript-eslint/no-explicit-any From edb739e293819d2b2a957bc1801c79ed160e67ce Mon Sep 17 00:00:00 2001 From: iAverages <31937542+iAverages@users.noreply.github.com> Date: Fri, 24 Mar 2023 22:59:17 +0000 Subject: [PATCH 2/4] Fix spacing of message --- cli/src/cli/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/cli/index.ts b/cli/src/cli/index.ts index 690f8ef093..a82a81ebcd 100644 --- a/cli/src/cli/index.ts +++ b/cli/src/cli/index.ts @@ -161,7 +161,7 @@ export const runCli = async () => { logger.warn(` WARNING: It looks like you are using Mintty which is non-interactive. Please run create-t3-app with another terminal such as Windows Terminal or PowerShell if you want to use the interactive CLI.`); logger.warn(` WARNING: If you are using Git Bash, please use Git Bash from another terminal, such as Windows Terminal - or the terminal build into Visual Studio Code.`); + or the terminal build into Visual Studio Code.`); const error = new Error("Non-interactive environment"); // eslint-disable-next-line @typescript-eslint/no-explicit-any From 344c0894157f2877afe7b08b1b560f42ba490f46 Mon Sep 17 00:00:00 2001 From: iAverages <31937542+iAverages@users.noreply.github.com> Date: Fri, 24 Mar 2023 23:10:38 +0000 Subject: [PATCH 3/4] Add changeset --- .changeset/smart-cherries-try.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/smart-cherries-try.md diff --git a/.changeset/smart-cherries-try.md b/.changeset/smart-cherries-try.md new file mode 100644 index 0000000000..bbb3511c39 --- /dev/null +++ b/.changeset/smart-cherries-try.md @@ -0,0 +1,5 @@ +--- +"create-t3-app": minor +--- + +Replace Git Bash check with Mintty check From fd60d8d42727d24427a4c7a062f872c9a9001924 Mon Sep 17 00:00:00 2001 From: iAverages <31937542+iAverages@users.noreply.github.com> Date: Sat, 25 Mar 2023 17:33:36 +0000 Subject: [PATCH 4/4] Change warning message --- cli/src/cli/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/src/cli/index.ts b/cli/src/cli/index.ts index a82a81ebcd..7d995594ec 100644 --- a/cli/src/cli/index.ts +++ b/cli/src/cli/index.ts @@ -158,10 +158,9 @@ export const runCli = async () => { // Explained below why this is in a try/catch block try { if (process.env.TERM_PROGRAM?.toLowerCase().includes("mintty")) { - logger.warn(` WARNING: It looks like you are using Mintty which is non-interactive. Please run create-t3-app with another - terminal such as Windows Terminal or PowerShell if you want to use the interactive CLI.`); - logger.warn(` WARNING: If you are using Git Bash, please use Git Bash from another terminal, such as Windows Terminal - or the terminal build into Visual Studio Code.`); + logger.warn(` WARNING: It looks like you are using MinTTY, which is non-interactive. This is most likely because you are + using Git Bash. If that's that case, please use Git Bash from another terminal, such as Windows Terminal. Alternatively, you + can provide the arguments from the CLI directly: https://create.t3.gg/en/installation#experimental-usage to skip the prompts.`); const error = new Error("Non-interactive environment"); // eslint-disable-next-line @typescript-eslint/no-explicit-any