Commit Graph
6 Commits
Author SHA1 Message Date
dotCooCoo c0487189bd Scripts: check then's parameters and keep a failed startup script's message
script.startup.run checks then's parameters as script.run checks them,
before any startup script runs. In the app, the message of a startup
script that fails or is stopped, through the quit prompt too, stays in
the status bar's notes after the chosen script ends.
2026-11-25 13:49:06 -08:00
dotCooCoo f906a0f814 Merge main into feat/scripts-startup-scripts 2026-11-25 09:16:13 -08:00
dotCooCoo 744faaab6c Tests: startup script tests remove their temporary folders
`tmp_dir` in `crates/engine/tests/script_startup.rs` now returns
`vectorcraft_testkit::TempDir`, which deletes the folder when the test
ends, also after a failed assertion. Before, every run left its folders
under the system temporary directory.
2026-11-22 13:20:56 -08:00
dotCooCoo 909c169afe Scripts: queued startup runs keep the file access scope of the request that queued them
In the app, script.startup.run starts only the first queued run inside the request; the later
startup scripts and the chosen script start from the frame loop. Each of them now starts, and its
file is read, in the scope captured when the queue was built, so a confined request's automation
roots apply to every run it queued.
2026-11-22 08:06:13 -08:00
dotCooCoo c85f3ebb5a Scripts: keep a stopped startup script's report and refuse a chosen script that cannot start
- A chosen script that script.run would refuse (a missing file, one larger
  than 8 MiB, bad parameters) ends script.startup.run with script.run's
  error before any startup script runs.
- When a queued run ends, the next one starts at the following pump, so
  the ended run's report stays for the status bar. The queue counts as a
  running script, so other runs and edits stay refused in that gap, and
  Stop asked for in it stops the run that starts next.
- Queued runs that could not start show in the status bar in the same
  frame, and the reply's failed list is not shown there again.
2026-11-22 05:48:51 -08:00
dotCooCoo 27011606a5 Scripts: run startup scripts at launch and before a chosen script
With Preferences > General > Run Startup Scripts on (off by default), the
.jsx files of the Startup Scripts folder next to the preferences run when
VectorCraft starts and before each script chosen from File > Scripts,
installed or Other Script..., one at a time and sorted by name without
regard to case. Each runs with the limits of any script and its own undo
step; one that cannot be read, is too large or fails is named in the
Script Console and the status bar, and the next one runs, then the chosen
script. Nothing runs in Safe Mode; after a launch that stopped, they run
once Disable and Continue or Start Normally is chosen, and the launch
marker names the running startup script so a stop there offers to disable
it. script.startup.run runs the folder; script.* is refused inside
scripts, so a startup script cannot start another round.
2026-11-21 20:20:34 -08:00