Skip to content

Commit f6685df

Browse files
barchiesiaxic
authored andcommitted
Add option to replace ':' with '-' in output filenames (for Windows). (#124)
Replace ':' (and `.` `/`) with '-' in output filenames for solcjs
1 parent 39d6635 commit f6685df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

solcjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,14 @@ function writeFile (file, content) {
106106
}
107107

108108
for (var contractName in output.contracts) {
109+
var contractFileName = contractName.replace(/[:./]/g, '_');
110+
109111
if (argv.bin) {
110-
writeFile(contractName + '.bin', output.contracts[contractName].bytecode);
112+
writeFile(contractFileName + '.bin', output.contracts[contractName].bytecode);
111113
}
112114

113115
if (argv.abi) {
114-
writeFile(contractName + '.abi', output.contracts[contractName].interface);
116+
writeFile(contractFileName + '.abi', output.contracts[contractName].interface);
115117
}
116118
}
117119

0 commit comments

Comments
 (0)