diff --git a/src/app.js b/src/app.js index 4e5ab92b75..d4bca5bfb0 100644 --- a/src/app.js +++ b/src/app.js @@ -86,7 +86,8 @@ var run = function () { function createNonClashingName (path) { 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 } return path + counter + '.sol'