-
Notifications
You must be signed in to change notification settings - Fork 619
Stylus CLI updates #7502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stylus CLI updates #7502
Changes from 1 commit
c01e0a8
54826fa
6e9a9ad
3fdb5be
feb0e4d
99b7764
c9dfa00
c37aff8
11149a3
a041415
16cabef
a9771c4
58fda78
3f976f6
4962bbc
2479b4c
764e808
62af2fc
16fdd1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,32 +43,37 @@ export async function createStylusProject() { | |
| choices: [ | ||
| { title: "Default", value: "default" }, | ||
| { title: "ERC20", value: "erc20" }, | ||
| { title: "ERC721", value: "erc721" }, | ||
| ], | ||
| message: "Select a template:", | ||
| name: "projectType", | ||
| type: "select", | ||
| }); | ||
|
|
||
| // Step 5: Create the project | ||
| let newProject; | ||
| if (projectType === "default") { | ||
| spinner.start(`Creating new Stylus project: ${projectName}...`); | ||
| const newProject = spawnSync("cargo", ["stylus", "new", projectName], { | ||
| newProject = spawnSync("cargo", ["stylus", "new", projectName], { | ||
| stdio: "inherit", | ||
| }); | ||
| if (newProject.status !== 0) { | ||
| spinner.fail("Failed to create Stylus project."); | ||
| process.exit(1); | ||
| } | ||
| } else if (projectType === "erc20") { | ||
| const repoUrl = "[email protected]:thirdweb-example/stylus-erc20-template.git"; | ||
| spinner.start(`Creating new ERC20 Stylus project: ${projectName}...`); | ||
| const clone = spawnSync("git", ["clone", repoUrl, projectName], { | ||
| newProject = spawnSync("git", ["clone", repoUrl, projectName], { | ||
| stdio: "inherit", | ||
| }); | ||
| if (clone.status !== 0) { | ||
| spinner.fail("Failed to create Stylus project."); | ||
| process.exit(1); | ||
| } | ||
| } else if (projectType === "erc721") { | ||
| const repoUrl = "[email protected]:thirdweb-example/stylus-erc721-template.git"; | ||
| spinner.start(`Creating new ERC721 Stylus project: ${projectName}...`); | ||
| newProject = spawnSync("git", ["clone", repoUrl, projectName], { | ||
| stdio: "inherit", | ||
| }); | ||
| } | ||
|
|
||
| if (!newProject?.status || newProject.status !== 0) { | ||
| spinner.fail("Failed to create Stylus project."); | ||
| process.exit(1); | ||
| } | ||
|
||
|
|
||
| spinner.succeed("Project created successfully."); | ||
|
|
||
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.
Add explicit type annotation to comply with coding guidelines.
The variable declaration violates the coding guidelines which require explicit types and avoiding
any. The implicitanytype should be replaced with the proper return type.📝 Committable suggestion
🤖 Prompt for AI Agents