Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video export cleanup #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions lib/shoebot.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const fs = require('fs');
const path = require('path');
const ConsoleView = require('./console-view');
const config = require('./config');
const isWin = process.platform === "win32";

export default {
process: null,
Expand All @@ -22,7 +23,7 @@ export default {
this.consoleView = new ConsoleView()
this.consoleView.initUI()
this.sbotDir = path.normalize(atom.config.get("shoebot.shoebot-dir"))
this.sbot = path.join(this.sbotDir, 'bin/sbot')
this.sbot = path.join(this.sbotDir, 'bin/sbot' + (isWin ? ".exe" : ""))
this.sbotvideo = path.join(this.sbotDir, 'bin/sbot-video-export')
},

Expand All @@ -47,7 +48,7 @@ export default {
editor = atom.workspace.getActivePaneItem()
scriptFile = editor.buffer.file
scriptDir = path.dirname(scriptFile.path)
command = this.sbot + ' --window ' + scriptFile.path
command = `${this.sbot} --window ${scriptFile.path}`
console.log("Running command: " + command)

if (this.process) {
Expand Down Expand Up @@ -163,15 +164,17 @@ export default {
exportErrormsg = null
exportProcess = spawn(command, {shell: true, detached: true, cwd: scriptDir}, (error, stdout, stderr) => {
if (error) {
console.log(error.stack);
console.log('Error code: '+error.code);
console.log('Signal received: '+error.signal);
console.error(error.stack);
console.error('Error code: ' + error.code);
console.error('Signal received: ' + error.signal);
}
rlafuente marked this conversation as resolved.
Show resolved Hide resolved
})
exportProcess.on('exit', function (code) {
if (!code) {
atom.notifications.addSuccess("Export finished!", {
description: "The sketch was output to " + result.filePath,
description: `The sketch was output to ${result.filePath} as a 10
second video. For other options, use the
[command line export script](https://docs.shoebot.net/getstarted.html#exporting-video).`
})
console.log(code)
} else {
Expand Down