@@ -8,7 +8,7 @@ const swal = require('sweetalert');
88const global = require ( "../../lib/global.js" )
99var fs = require ( 'fs' ) ;
1010const pythonFunction = require ( "../../lib/datafunctions" ) ;
11-
11+ const path = require ( 'path' ) ;
1212
1313$ ( "#draw-sidebar-right" ) . hide ( ) ;
1414$ ( "#codenode-desc" ) . hide ( ) ;
@@ -19,7 +19,7 @@ let isSelected = false;
1919let temparrow ;
2020let firstblock ;
2121let dir = global . projectDetails . name ;
22- let basepath = process . cwd ( ) + "/../testing/Projects/" ;
22+ let basepath = path . join ( process . cwd ( ) , "/../testing/Projects/" ) ;
2323
2424let graph = global . graph ;
2525graph . modelStage = new Konva . Stage ( {
@@ -33,7 +33,7 @@ stage.add(layer);
3333
3434
3535if ( ! global . isLoaded . nodeeditor ) {
36- let graphdata = fs . readFileSync ( basepath + dir + "/ graph.json") ;
36+ let graphdata = fs . readFileSync ( path . join ( basepath , dir , " graph.json") ) ;
3737 let savedGraph = JSON . parse ( graphdata ) ;
3838 let temphash = { } ;
3939
@@ -406,11 +406,11 @@ $("#goNext").click(function () {
406406 }
407407
408408 global . extraText += `
409- tensorboard = TensorBoard(log_dir="../testing/Projects/${ global . projectDetails . name } /logs/{}".format(asctime()), histogram_freq=0,write_graph=True,write_grads=True,write_images=True)
409+ tensorboard = TensorBoard(log_dir="../testing/Projects/${ global . projectDetails . name } /logs/{}".format(asctime()).replace(":","-") , histogram_freq=0,write_graph=True,write_grads=True,write_images=True)
410410
411411`
412412
413- fs . writeFile ( basepath + dir + "/ editor.py", global . extraText + global . functionsText + global . modelText , 'utf-8' , err => {
413+ fs . writeFile ( path . join ( basepath , dir , " editor.py") , global . extraText + global . functionsText + global . modelText , 'utf-8' , err => {
414414 if ( err ) {
415415 swal ( "Saving Project" , "Failed to save project." , "error" ) ;
416416 print ( "Error writing file" , err ) ;
@@ -443,7 +443,7 @@ function saveProject() {
443443 } ) ;
444444 } ) ;
445445
446- fs . writeFile ( basepath + dir + "/ graph.json", JSON . stringify ( data ) , 'utf-8' , err => {
446+ fs . writeFile ( path . join ( basepath , dir , " graph.json") , JSON . stringify ( data ) , 'utf-8' , err => {
447447 if ( err ) {
448448 swal ( "Saving Project" , "Failed to save project." , "error" ) ;
449449 print ( "Error writing file" , err ) ;
0 commit comments