Commit ed71a0e2 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #583 from ethereum/fixCreateNewFile

Fix new file creation
parents 61274a31 c9780ec9
...@@ -86,7 +86,8 @@ var run = function () { ...@@ -86,7 +86,8 @@ var run = function () {
function createNonClashingName (path) { function createNonClashingName (path) {
var counter = '' var counter = ''
while (files.exists(path + counter)) { if (path.endsWith('.sol')) path = path.substring(0, path.lastIndexOf('.sol'))
while (files.exists(path + counter + '.sol')) {
counter = (counter | 0) + 1 counter = (counter | 0) + 1
} }
return path + counter + '.sol' return path + counter + '.sol'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment