Skip to content

Commit

Permalink
fixes cleanup examples bug
Browse files Browse the repository at this point in the history
  • Loading branch information
akaJes committed Jul 26, 2017
1 parent c905f50 commit a5ee2b4
Show file tree
Hide file tree
Showing 9 changed files with 87,861 additions and 11 deletions.
12 changes: 8 additions & 4 deletions app/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ app.get('/upnp/open', function (req, res) {
});
})
app.get('/upnp/local', function (req, res) {
res.send({ip:getIP(),port:httpPort,https:httpsPort});
res.send({ip:getIP()[0],port:httpPort,https:httpsPort});
})
app.get('/upnp/check', function (req, res) {
natClient.getMappings(function(err, results) {
Expand Down Expand Up @@ -311,6 +311,7 @@ app.get('/restore/:path', function (req, res) {
var p=atob(decodeURI(req.params.path)).toString();
git.root()
.then(root=>path.join(root,store,p))
.then(dir=>promisify(fs.stat)(dir).catch(a=>{throw 'no files';}).then(a=>dir))
.then(walk)
.then(files=>{
var up=files
Expand All @@ -325,15 +326,16 @@ app.get('/restore/:path', function (req, res) {
//return (uploadFiles(up));
return uploadFiles(up).then(up=>Promise.all([...up,...cp]));
})
// .then(e=>res.status(403).send(e))
.then(a=>res.send(a))
.catch(e=>res.status(403).send(e))
});
app.get('/saved', function (req, res) {
git.root()
.then(root=>{
var ex=path.join(root,store)
return walk(ex)
var ex=path.join(root,store);
return Promise.resolve(ex)
.then(dir=>promisify(fs.stat)(dir).catch(a=>{throw 'no files';}).then(a=>dir))
.then(walk)
.then(a=>a.filter(i=>/Configuration(_adv)?\.h/.test(i)))
.then(a=>a.map(i=>path.parse(path.relative(ex,i)).dir))
.then(unique)
Expand All @@ -354,6 +356,7 @@ app.get('/saved', function (req, res) {
return {tree:recurseObj(obj),info:info};
})
.then(a=>res.send(a))
.catch(e=>res.status(403).send(e))
})
});

Expand Down Expand Up @@ -439,6 +442,7 @@ app.get('/pio/:env/:port', function (req, res) {
params.push('-e',req.params.env);
if (close)
params.push('--upload-port',port)
console.log(params); //if removed - process hangs :)
(close&&serial_enabled?serial.close(port):Promise.resolve(true))
.then(pioRoot)
.then(root=>{
Expand Down
4 changes: 2 additions & 2 deletions builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var config=Object.assign({},pjson.build);

//prebuild serialport
config.beforeBuild=(args)=>new Promise((done,fail)=>{
if (args.platform.nodeName=='darwin')//skip it
return done();
// if (args.platform.nodeName=='darwin')//skip it
// return done();
var cmd = 'npm rebuild serialport-v4 --update-binary'
+ ' --target_platform='+args.platform.nodeName+' --target_arch='+args.arch
+ ' --runtime=electron --target='+electron_version
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "marlin-conf",
"version": "2.7.9",
"version": "2.7.10",
"description": "configuration tool for Marlin project",
"main": "./index.js",
"scripts": {
Expand Down Expand Up @@ -78,16 +78,15 @@
"socket.io": "^2.0.1",
"swig-templates": "^2.0.2",
"tether": "^1.4.0",
"three": "^0.85.2",
"tty2html": "^1.0.0",
"universal-analytics": "^0.4.13",
"which": "^1.2.14"
},
"devDependencies": {
"devtron": "^1.4.0",
"electron": "^1.6.10",
"electron-builder": "^18.1.0",
"eslint": "^3.19.0",
"electron-builder": "*",
"eslint": "^4.3.0",
"json": "^9.0.6",
"nodemon": "^1.11.0"
}
Expand Down
2 changes: 1 addition & 1 deletion static/consoles.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<script src="libs/tether/dist/js/tether.min.js"></script>
<script src="libs/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="libs/socket.io-client/dist/socket.io.js"></script>
<script src="libs/three/build/three.js"></script>
<script src="git/three/build/three.js"></script>
<script src="git/three/examples/js/renderers/Projector.js"></script>
<script src="git/three/examples/js/renderers/CanvasRenderer.js"></script>
<script src="git/three/examples/js/controls/OrbitControls.js"></script>
Expand Down
Loading

0 comments on commit a5ee2b4

Please sign in to comment.