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

add configurable boot file path #27

Merged
merged 1 commit into from
Jan 15, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 9 additions & 4 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var fs = require('fs');
var spawn = require('child_process').spawn;
var Range = require('atom').range;
var bootFilePath = __dirname + "/BootTidal.hs"
var defaultBootFilePath = __dirname + "/BootTidal.hs"
var CONST_LINE = 'line'
var CONST_MULTI_LINE = 'multi_line'

Expand Down Expand Up @@ -57,12 +57,17 @@ export default class REPL {
}

getGhciPath() {
var path = atom.config.get('tidalcycles.ghciPath');
return path;
return atom.config.get('tidalcycles.ghciPath');
}

getBootTidalPath() {
return atom.config.get('tidalcycles.bootTidalPath');
}

initTidal() {
var commands = fs.readFileSync(bootFilePath).toString().split('\n');
const configuredBootFilePath = this.getBootTidalPath();
const actualBootPath = configuredBootFilePath !== "" ? configuredBootFilePath : defaultBootFilePath;
var commands = fs.readFileSync(actualBootPath).toString().split('\n');
for (var i = 0; i < commands.length; i++) {
this.tidalSendLine(commands[i]);
}
Expand Down
4 changes: 4 additions & 0 deletions lib/tidalcycles.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export default {
"ghciPath": {
type: "string",
default: "ghci"
},
"bootTidalPath": {
type: "string",
default: ""
}
},

Expand Down