@mcmcjs/julia 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ __export(index_exports, {
36
36
  planSetup: () => planSetup,
37
37
  predictData: () => predictData,
38
38
  removeVersion: () => removeVersion,
39
+ resolveJulia: () => resolveJulia,
39
40
  resolveVersion: () => resolveVersion,
40
41
  runDoctor: () => runDoctor,
41
42
  runFit: () => runFit,
@@ -909,6 +910,15 @@ async function resolveVersion(bin, channel, run) {
909
910
  }
910
911
  return { command: match.File, args: match.Args ?? [], version: match.Version };
911
912
  }
913
+ async function resolveJulia(channel, run) {
914
+ const juliaup = await detectJuliaup(run);
915
+ if (juliaup.found && juliaup.path) return resolveVersion(juliaup.path, channel, run);
916
+ const julia = await detectJulia(run);
917
+ if (julia.found && julia.path && julia.version === channel) {
918
+ return { command: julia.path, args: [], version: julia.version };
919
+ }
920
+ throw new Error("juliaup not found. Run `mcmc setup` to install the Julia toolchain.");
921
+ }
912
922
  function assertVersionsInstalled(channels, installed) {
913
923
  const have = new Set(installed.map((v) => v.id));
914
924
  const missing = channels.filter((c) => !have.has(c));
@@ -1267,6 +1277,7 @@ async function stopWorker(socket) {
1267
1277
  planSetup,
1268
1278
  predictData,
1269
1279
  removeVersion,
1280
+ resolveJulia,
1270
1281
  resolveVersion,
1271
1282
  runDoctor,
1272
1283
  runFit,