Skip to content

Commit

Permalink
Fix packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
jes committed Apr 12, 2022
1 parent 6a6f78e commit bd585c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ ipcMain.on('render-heightmap', (event,arg) => {
// TODO: write outputs to project folder; also, write to a
// temporary file until successful, then move to the project
// folder
let render = spawn('./bin/pngcam-render', opts);
let render = spawn(path.join(__dirname,'bin/pngcam-render'), opts);
running = render;

render.stderr.on('data', (data) => {
Expand Down Expand Up @@ -98,7 +98,7 @@ ipcMain.on('generate-toolpath', (event,arg) => {
let gcodeFile = tmp.fileSync().name;
let gcodeStream = fs.createWriteStream(gcodeFile);
gcodeStream.on('open', function() {
let pngcam = spawn('./bin/pngcam', opts, {
let pngcam = spawn(path.join(__dirname, 'bin/pngcam'), opts, {
stdio: ['pipe', gcodeStream, 'pipe'], // send stdout to a file
});
running = pngcam;
Expand Down
21 changes: 20 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0",
"yarn": "^1.22.18"
"line-reader": "^0.4.0",
"tmp": "^0.2.1"
},
"config": {
"forge": {
Expand All @@ -44,5 +45,23 @@
}
]
}
},
"build": {
"extraResources": [
{
"from": "./bin/pngcam",
"to": "bin/pngcam",
"filter": [
"**/*"
]
},
{
"from": "./bin/pngcam-render",
"to": "bin/pngcam-render",
"filter": [
"**/*"
]
}
]
}
}

0 comments on commit bd585c8

Please sign in to comment.