Skip to content

Commit

Permalink
Merge pull request #24 from iwizardpro/patch-2
Browse files Browse the repository at this point in the history
Version history functionality (Quotes in file paths, disable reverting on error)
  • Loading branch information
coreh committed Dec 29, 2011
2 parents 2c5735a + 4752caf commit f38e179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/js/CodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@
var loadVersionNumbered = function(i) {
if (!versions[i].content) {
connection.loadVersion(versions[i].uuid, function(err, contents) {
galaxyBackground.revert.disabled = false;
if (err) {
contents = '<ERROR: Could not load file contents>'
contents = '<ERROR: Could not load file contents>';
galaxyBackground.revert.disabled = true;
}
var codeMirror = createCodeMirror(versionEditors[i], contents, entry.path, { readOnly: true })
versions[i].content = contents;
Expand Down
2 changes: 1 addition & 1 deletion server/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ setInterval(function() {
date: (new Date()).valueOf(),
uuid: generatedUuid
})
exec('cp -- "' + (process.cwd() + file) + '" "' + (process.cwd() + '/.nide/' + generatedUuid) + '"', function(err) {
exec('cp -- "' + (process.cwd() + file).replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0') + '" "' + (process.cwd() + '/.nide/' + generatedUuid).replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0') + '"', function(err) {
if (!err) {
saveVersionHistory()
}
Expand Down

0 comments on commit f38e179

Please sign in to comment.