|
@ -252,8 +252,10 @@ function doCreateProject(title, path) { |
|
|
files: [ contractsFile, indexFile ] |
|
|
files: [ contractsFile, indexFile ] |
|
|
}; |
|
|
}; |
|
|
//TODO: copy from template
|
|
|
//TODO: copy from template
|
|
|
fileIo.writeFile(dirPath + indexFile, htmlTemplate); |
|
|
if (!fileIo.fileExists(dirPath + indexFile)) |
|
|
fileIo.writeFile(dirPath + contractsFile, contractTemplate); |
|
|
fileIo.writeFile(dirPath + indexFile, htmlTemplate); |
|
|
|
|
|
if (!fileIo.fileExists(dirPath + contractsFile)) |
|
|
|
|
|
fileIo.writeFile(dirPath + contractsFile, contractTemplate); |
|
|
newProject(projectData); |
|
|
newProject(projectData); |
|
|
var json = JSON.stringify(projectData, null, "\t"); |
|
|
var json = JSON.stringify(projectData, null, "\t"); |
|
|
fileIo.writeFile(projectFile, json); |
|
|
fileIo.writeFile(projectFile, json); |
|
@ -340,7 +342,8 @@ function newContract() { |
|
|
function createAndAddFile(name, extension, content) { |
|
|
function createAndAddFile(name, extension, content) { |
|
|
var fileName = generateFileName(name, extension); |
|
|
var fileName = generateFileName(name, extension); |
|
|
var filePath = projectPath + fileName; |
|
|
var filePath = projectPath + fileName; |
|
|
fileIo.writeFile(filePath, content); |
|
|
if (!fileIo.fileExists(filePath)) |
|
|
|
|
|
fileIo.writeFile(filePath, content); |
|
|
var id = addFile(fileName); |
|
|
var id = addFile(fileName); |
|
|
saveProjectFile(); |
|
|
saveProjectFile(); |
|
|
documentAdded(id); |
|
|
documentAdded(id); |
|
|