Skip to content

Commit

Permalink
Remove mnemonic file cp
Browse files Browse the repository at this point in the history
  • Loading branch information
carletex committed Aug 15, 2022
1 parent 56d89b1 commit b7045ed
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions install.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
var fs = require("fs");
const util = require('util');
const exec = util.promisify(require('child_process').exec);
const util = require("util");
const exec = util.promisify(require("child_process").exec);

const challenges = JSON.parse(fs.readFileSync("challenges.json").toString());

const setupChallenge = async challenge => {
const setupChallenge = async (challenge) => {
try {
if (!fs.existsSync(`./${challenge.name}`)) {
console.log("====] CLONING " + challenge.name + "[==============]");
const result1 = await exec('git clone -b ' + challenge.name + ' ' + challenge.github + ' ' + challenge.name);
const result1 = await exec(
"git clone -b " +
challenge.name +
" " +
challenge.github +
" " +
challenge.name
);
console.log(`stdout: ${result1.stdout}\n`);
console.log(`stderr: ${result1.stderr}\n`);
}

console.log("====] UPDATING " + challenge.name + "[==============]");
const result2 = await exec('cd ' + challenge.name + ' && git pull && yarn install');
const result2 = await exec(
"cd " + challenge.name + " && git pull && yarn install"
);
console.log(`stdout: ${result2.stdout}\n`);
console.log(`stderr: ${result2.stderr}\n`);

console.log("====] INSTALLING "+challenge.name+" MNEMONIC[==============]")
const result3 = await exec('cp mnemonic.txt ' + challenge.name + '/packages/hardhat/');
console.log(`stdout: ${result3.stdout}\n`);
console.log(`stderr: ${result3.stderr}\n`);

} catch(e){
} catch (e) {
console.log(e);
}
}
};

(async () => {
for (let c in challenges) {
Expand All @@ -35,4 +38,3 @@ const setupChallenge = async challenge => {
await setupChallenge(challenge);
}
})();

0 comments on commit b7045ed

Please sign in to comment.