Skip to content

Commit

Permalink
Merge pull request ethereum#583 from ethereum/fixCreateNewFile
Browse files Browse the repository at this point in the history
Fix new file creation
  • Loading branch information
yann300 authored Jun 7, 2017
2 parents 61274a3 + c9780ec commit ed71a0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit ed71a0e

Please sign in to comment.