Closed slavaGanzin closed 6 years ago
Hi @slavaGanzin (sorry about the late reply).
I feel this kind of functionality belongs to Hydrogen. I've opened issue https://github.com/nteract/hydrogen/issues/1419 to discuss a more general solution that would let users select a working directory when they start a kernel.
@slavaGanzin a quick question: at the moment, how do you run your hack? do you use the setting startupCode
?
Yes. You are right:
startupCode: '''
{"Python 3": "%matplotlib inline", "Javascript (Node.js)": "(function f() {try { require('fs').readFileSync('package.json') } catch(e) {process.chdir('..'); f()}})()"}
'''
Hello Nicolas.
I had trouble with relative paths in js using Hydrogen. By default it works well: you almost always have package.json in your atom project folder, so you can use Hydrogen's option to start kernel from there. But if you have nested projects(wich starts from theirs folders) in one project it becomes a harder.
So I write a little bit of a hack:
And I think it can be integrated in ijavascript as an option. What do you think?