Skip to content

Commit a5ee2b4

Browse files
committed
fixes cleanup examples bug
1 parent c905f50 commit a5ee2b4

File tree

9 files changed

+87861
-11
lines changed

9 files changed

+87861
-11
lines changed

app/server.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ app.get('/upnp/open', function (req, res) {
8787
});
8888
})
8989
app.get('/upnp/local', function (req, res) {
90-
res.send({ip:getIP(),port:httpPort,https:httpsPort});
90+
res.send({ip:getIP()[0],port:httpPort,https:httpsPort});
9191
})
9292
app.get('/upnp/check', function (req, res) {
9393
natClient.getMappings(function(err, results) {
@@ -311,6 +311,7 @@ app.get('/restore/:path', function (req, res) {
311311
var p=atob(decodeURI(req.params.path)).toString();
312312
git.root()
313313
.then(root=>path.join(root,store,p))
314+
.then(dir=>promisify(fs.stat)(dir).catch(a=>{throw 'no files';}).then(a=>dir))
314315
.then(walk)
315316
.then(files=>{
316317
var up=files
@@ -325,15 +326,16 @@ app.get('/restore/:path', function (req, res) {
325326
//return (uploadFiles(up));
326327
return uploadFiles(up).then(up=>Promise.all([...up,...cp]));
327328
})
328-
// .then(e=>res.status(403).send(e))
329329
.then(a=>res.send(a))
330330
.catch(e=>res.status(403).send(e))
331331
});
332332
app.get('/saved', function (req, res) {
333333
git.root()
334334
.then(root=>{
335-
var ex=path.join(root,store)
336-
return walk(ex)
335+
var ex=path.join(root,store);
336+
return Promise.resolve(ex)
337+
.then(dir=>promisify(fs.stat)(dir).catch(a=>{throw 'no files';}).then(a=>dir))
338+
.then(walk)
337339
.then(a=>a.filter(i=>/Configuration(_adv)?\.h/.test(i)))
338340
.then(a=>a.map(i=>path.parse(path.relative(ex,i)).dir))
339341
.then(unique)
@@ -354,6 +356,7 @@ app.get('/saved', function (req, res) {
354356
return {tree:recurseObj(obj),info:info};
355357
})
356358
.then(a=>res.send(a))
359+
.catch(e=>res.status(403).send(e))
357360
})
358361
});
359362

@@ -439,6 +442,7 @@ app.get('/pio/:env/:port', function (req, res) {
439442
params.push('-e',req.params.env);
440443
if (close)
441444
params.push('--upload-port',port)
445+
console.log(params); //if removed - process hangs :)
442446
(close&&serial_enabled?serial.close(port):Promise.resolve(true))
443447
.then(pioRoot)
444448
.then(root=>{

builder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ var config=Object.assign({},pjson.build);
1818

1919
//prebuild serialport
2020
config.beforeBuild=(args)=>new Promise((done,fail)=>{
21-
if (args.platform.nodeName=='darwin')//skip it
22-
return done();
21+
// if (args.platform.nodeName=='darwin')//skip it
22+
// return done();
2323
var cmd = 'npm rebuild serialport-v4 --update-binary'
2424
+ ' --target_platform='+args.platform.nodeName+' --target_arch='+args.arch
2525
+ ' --runtime=electron --target='+electron_version

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "marlin-conf",
3-
"version": "2.7.9",
3+
"version": "2.7.10",
44
"description": "configuration tool for Marlin project",
55
"main": "./index.js",
66
"scripts": {
@@ -78,16 +78,15 @@
7878
"socket.io": "^2.0.1",
7979
"swig-templates": "^2.0.2",
8080
"tether": "^1.4.0",
81-
"three": "^0.85.2",
8281
"tty2html": "^1.0.0",
8382
"universal-analytics": "^0.4.13",
8483
"which": "^1.2.14"
8584
},
8685
"devDependencies": {
8786
"devtron": "^1.4.0",
8887
"electron": "^1.6.10",
89-
"electron-builder": "^18.1.0",
90-
"eslint": "^3.19.0",
88+
"electron-builder": "*",
89+
"eslint": "^4.3.0",
9190
"json": "^9.0.6",
9291
"nodemon": "^1.11.0"
9392
}

static/consoles.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<script src="libs/tether/dist/js/tether.min.js"></script>
1919
<script src="libs/bootstrap/dist/js/bootstrap.min.js"></script>
2020
<script src="libs/socket.io-client/dist/socket.io.js"></script>
21-
<script src="libs/three/build/three.js"></script>
21+
<script src="git/three/build/three.js"></script>
2222
<script src="git/three/examples/js/renderers/Projector.js"></script>
2323
<script src="git/three/examples/js/renderers/CanvasRenderer.js"></script>
2424
<script src="git/three/examples/js/controls/OrbitControls.js"></script>

0 commit comments

Comments
 (0)