Open abraemer opened 1 year ago
A problem I found while using the package: add
failed to add the code for a package, but still added the first line. So startup.jl
now contains the starting line for one module, but nothing else.
This leads to errors by _parse_startup_file
: as you do not check whether modules_starts
and modules_ends
have the same length, atline = module_ends[atmodule]+1
fails (because atmodule
has a value of 1
and module_ends
is empty.
I realize a fully robust parser would need to do more that check the two above lengths are equal, but this would improve a startup.jl
state which the package itself generated.
Right now this package is not very robust: Exceptions during writing a module leaves the
startup.jl
in a bad state, that does not work correctly and can't be parsed anymore. We should do:startup.jl
better. At the very least don't just error-out, but give the user a sensible error message.startup.jl
prior to modification and roll back if errors occured.