-
Notifications
You must be signed in to change notification settings - Fork 1
/
.setup.js
33 lines (27 loc) · 1.5 KB
/
.setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
const fs = require('fs-extra');
function copyFromDefault(p) {
if (!fs.existsSync(p)) {
const defaultFile = `${p}.default`;
if (fs.existsSync(defaultFile)) {
fs.copyFileSync(`${p}.default`, p);
}
}
}
[/*'.vscode/settings.json', */ '.vscode/extensions.json', '.vscode/launch.json'].map(copyFromDefault);
// needed for dapptools as it does not allow to set further --allow-path to solc and solc does not support symlink very well it seems
fs.emptyDirSync('_lib/');
fs.emptyDirSync('_lib/openzeppelin/contracts');
fs.copySync('node_modules/@openzeppelin/contracts', '_lib/openzeppelin/contracts', {dereference: true});
fs.emptyDirSync('_lib/rari-capital/solmate/src');
fs.copySync('node_modules/@rari-capital/solmate/src', '_lib/rari-capital/solmate/src', {dereference: true});
fs.emptyDirSync('_lib/hardhat');
fs.copySync('node_modules/hardhat/console.sol', '_lib/hardhat/console.sol', {dereference: true});
fs.emptyDirSync('_lib/base64-sol');
fs.copySync('node_modules/base64-sol', '_lib/base64-sol', {dereference: true});
fs.emptyDirSync('_lib/hardhat-deploy/solc_0.6');
fs.copySync('node_modules/hardhat-deploy/solc_0.6', '_lib/hardhat-deploy/solc_0.6', {dereference: true});
fs.emptyDirSync('_lib/hardhat-deploy/solc_0.7');
fs.copySync('node_modules/hardhat-deploy/solc_0.7', '_lib/hardhat-deploy/solc_0.7', {dereference: true});
fs.emptyDirSync('_lib/hardhat-deploy/solc_0.8');
fs.copySync('node_modules/hardhat-deploy/solc_0.8', '_lib/hardhat-deploy/solc_0.8', {dereference: true});