Skip to content

Commit

Permalink
fix: clone repos remotely
Browse files Browse the repository at this point in the history
  • Loading branch information
idea404 committed Oct 3, 2023
1 parent 5d63b7c commit 4ef4af9
Show file tree
Hide file tree
Showing 3 changed files with 980 additions and 980 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"@semantic-release/npm": "^8.0.3",
"@semantic-release/release-notes-generator": "^10.0.3",
"@types/figlet": "^1.5.6",
"@types/fs-extra": "^11.0.2",
"@types/inquirer": "^8.0.2",
"@types/jest": "^29.5.4",
"@types/node": "^18.17.12",
Expand Down
16 changes: 8 additions & 8 deletions src/commands/create-project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Option } from "commander";
import fs from "fs-extra";
import { prompt } from "inquirer";
import path from "path";

Expand All @@ -17,37 +16,37 @@ const templates = [
name: "Hardhat + Solidity",
framework: "hardhat_solidity",
project: "hello_world",
dir: path.join(__dirname, "../templates/hh-sol-hw"),
git: "https://github.com/matter-labs/zksync-hardhat-template",
},
{
name: "Hardhat + Solidity",
framework: "hardhat_solidity",
project: "fungible_token",
dir: path.join(__dirname, "../templates/hh-sol-ft"),
git: "https://github.com/matter-labs/zksync-hardhat-ft-template",
},
{
name: "Hardhat + Solidity",
framework: "hardhat_solidity",
project: "non_fungible_token",
dir: path.join(__dirname, "../templates/hh-sol-nft"),
git: "https://github.com/matter-labs/zksync-hardhat-nft-template"
},
{
name: "Hardhat + Vyper",
framework: "hardhat_vyper",
project: "hello_world",
dir: path.join(__dirname, "../templates/hh-vyp-hw"),
git: "https://github.com/matter-labs/zksync-hardhat-vyper-template",
},
{
name: "Hardhat + Vyper",
framework: "hardhat_vyper",
project: "fungible_token",
dir: path.join(__dirname, "../templates/hh-vyp-ft"),
git: "https://github.com/matter-labs/zksync-hardhat-vyper-ft-template"
},
{
name: "Hardhat + Vyper",
framework: "hardhat_vyper",
project: "non_fungible_token",
dir: path.join(__dirname, "../templates/hh-vyp-nft"),
git: "https://github.com/matter-labs/zksync-hardhat-vyper-nft-template"
},
];

Expand Down Expand Up @@ -118,7 +117,8 @@ export const handler = async (folderName: string, options: CreateOptions) => {
const template = templates.find((e) => e.framework === options.framework && e.project === options.project)!;

Logger.info(`\nCreating new project from "${template.name}" template at "${path.join(options.folderName!, "/")}"`);
fs.copySync(template.dir, options.folderName!);
executeCommand(`git clone ${template.git} ${options.folderName}`);
executeCommand(`cd ${options.folderName} && rm -rf -r .git`); // removes .git folder so new repo can be initialized

Logger.info("\nInstalling dependencies with yarn...");
executeCommand(`cd ${options.folderName} && yarn`);
Expand Down
Loading

0 comments on commit 4ef4af9

Please sign in to comment.