Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mozilla/thimble.mozilla.org#1564 - Check for existing file with name before creating a new file #566

Merged
merged 2 commits into from
Nov 9, 2016

Conversation

gideonthomas
Copy link

To test this (try on both master and this pr):

  • npm start
  • Open your console and type in bramble.addNewFile({basenamePrefix: "script", contents: "Hi", ext: ".js"}, function(err) { console.log("Added new file with: ", err); });. This should create a script-1.js file.
  • Refresh the page
  • Run that command in the console again

In my patch, after you run the second command you should have a script-2.js file; on master, it should overwrite your script-1.js file.

@humphd r?

extension = "";
}

var suggestedName = baseFileName + "-" + _nextUntitledIndexToUse++ + extension,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so it doesn't read like a mistake, let's wrap _nextUntitledIndexToUse++ in (...)

@humphd
Copy link

humphd commented Nov 8, 2016

This works great! Just make that one fix to the code I mentioned above and r=me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants