-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
antoine lanoe
committed
Apr 19, 2023
1 parent
b7ad170
commit e53567a
Showing
8 changed files
with
390 additions
and
42 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import ora from "ora"; | ||
import { spawn } from "child_process"; | ||
|
||
export async function installDependencies(command, projectPath) { | ||
return new Promise((resolve, reject) => { | ||
const installationProcess = spawn(command, ["install"], { | ||
cwd: projectPath, | ||
stdio: "pipe", | ||
}); | ||
const spinner = ora("Installing dependencies...").start(); | ||
spinner.color = "yellow"; | ||
installationProcess.on("error", (error) => { | ||
spinner.fail("Failed to install dependencies"); | ||
reject(error); | ||
}); | ||
|
||
installationProcess.on("exit", () => { | ||
spinner.succeed("Dependencies installed successfully"); | ||
resolve(); | ||
}); | ||
}); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const question = [ | ||
{ | ||
name: "project-name", | ||
type: "input", | ||
message: "Project name:", | ||
validate: function (input) { | ||
if (/^([A-Za-z\-\_\d])+$/.test(input)) { | ||
return true; | ||
} | ||
return "Sorry, your project name must only include letters, numbers, dashes or underscores."; | ||
}, | ||
}, | ||
]; |
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
Oops, something went wrong.