phma
April 23, 2025, 8:38am
1
I need to run a Pkg command on several remote boxen. I wrote a file like this:
]
dev ../Foo/ ../Bar/ ../Baz/ ../Quux/
and ran julia --project -i </path/to/file
in the project directory. Julia responded:
ERROR: ParseError:
# Error @ none:1:1
]
╙ ── unexpected `]`
Stacktrace:
[1] top-level scope
@ none:1
If I run julia --project -i
and then type ]
, I get a pkg>
prompt and can run dev
. How do I get Julia to run an interactive session with input from a file instead of the keyboard?
I believe ]
is only recognized when you directly type it in REPL (Pasting "]" into the Julia REPL is inconsistent across platforms · Issue #58041 · JuliaLang/julia · GitHub ).
You can use Pkg
this way instead:
using Pkg
Pkg.develop(path="../Foo")
Pkg.develop(path="../Bar")
Pkg.develop(path="../Baz")
which can be called from the CLI:
julia --project -e 'using Pkg; Pkg.develop(path="../Foo"); Pkg.develop(path="../Bar"); Pkg.develop(path="../Baz");'
phma
April 23, 2025, 9:40am
3
I know that
dev ../Foo/
dev ../Bar/
doesn’t work, because of dependencies. Can I call Pkg.develop
with multiple arguments?
Pkg.develop([Pkg.PackageSpec(path="../Foo"),
Pkg.PackageSpec(path="../Bar"),
Pkg.PackageSpec(path="../Baz")])
Not sure if there’s a more convenient interface.
1 Like
jules
April 23, 2025, 12:20pm
5
you can also do pkg"dev ..."
phma
April 24, 2025, 7:44pm
6
I think I’ll try that, but if not I’ll just do it by hand. There are only 12 boxen, and I don’t think I’ll have to do it more than once for each.