Skip to content

Commit c87f873

Browse files
committed
pkg server setting
1 parent 30c4659 commit c87f873

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

lib/connection/process/basic.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export function get_ (path, args) {
2626

2727
export function customEnv (env = process.env) {
2828
let confnt = atom.config.get('julia-client.juliaOptions.numberOfThreads')
29+
let pkgServer = atom.config.get('julia-client.juliaOptions.packageServer')
2930
let confntInt = parseInt(confnt)
3031

3132
if (confnt == 'auto') {
@@ -34,6 +35,10 @@ export function customEnv (env = process.env) {
3435
env.JULIA_NUM_THREADS = confntInt
3536
}
3637

38+
if (pkgServer) {
39+
env.JULIA_PKG_SERVER = pkgServer
40+
}
41+
3742
if (atom.config.get('julia-client.disableProxy')) {
3843
delete env.HTTP_PROXY
3944
delete env.HTTPS_PROXY

lib/connection/process/remote.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ export function get_ (path, args) {
180180
let sessionName = atom.config.get('julia-client.remoteOptions.tmuxName')
181181
exec += `/bin/sh -c '`
182182
exec += `tmux new -s ${sessionName} '\\''`
183+
if (pkgServer()) {
184+
exec += ` JULIA_PKG_SERVER="${pkgServer()}" `
185+
}
183186
if (threadCount() !== undefined) {
184187
exec += ` JULIA_NUM_THREADS="${threadCount()}" `
185188
}
@@ -194,8 +197,11 @@ export function get_ (path, args) {
194197
exec += `'`
195198
} else {
196199
exec += `/bin/sh -c '`
200+
if (pkgServer()) {
201+
exec += ` JULIA_PKG_SERVER="${pkgServer()}" `
202+
}
197203
if (threadCount() !== undefined) {
198-
exec += `JULIA_NUM_THREADS="${threadCount()}" `
204+
exec += ` JULIA_NUM_THREADS="${threadCount()}" `
199205
}
200206
exec += `${jlpath} ${args.join(' ')} -e '\\''`
201207
// could automatically escape single quotes with `replace(/'/, `'\\'\\\\\\'\\''`)`,
@@ -286,6 +292,10 @@ export function get_ (path, args) {
286292
})
287293
}
288294

295+
function pkgServer () {
296+
return atom.config.get('julia-client.juliaOptions.packageServer')
297+
}
298+
289299
function threadCount () {
290300
let confnt = atom.config.get('julia-client.juliaOptions.numberOfThreads')
291301
let confntInt = parseInt(confnt)

lib/package/config.coffee

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ config =
2828
default: 'Basic'
2929
radio: true
3030
order: 1
31+
packageServer:
32+
title: 'Package Server'
33+
type: 'string'
34+
description: 'Julia package server. Set\'s the `JULIA_PKG_SERVER` environment
35+
variable *before* starting a Julia process. Leave this empty to
36+
use the systemwide default.
37+
Requires a restart of the Julia process.'
38+
default: ''
39+
order: 1.5
3140
optimisationLevel:
3241
title: 'Optimisation Level'
3342
description: 'Higher levels take longer to compile, but produce faster code.'

0 commit comments

Comments
 (0)