[REQUEST] "Skip Stage" option while script is running

To do this safely and manually, you can edit Tron.bat. Editing the script file doesn't affect the currently running command; the change won't be noticed until the current command completes, and the command interpreter returns to see what the next line is.

The currently running stage is listed in the title bar, so you can find it in Tron.bat by searching for the title string, e.g., Ctrl+F: "[stage_2_de-bloat] [Remove bloatware by name]". Scroll down to the end of the job, add a PAUSE command on the next line, and save. This will give you time to figure out what you want to do next. I would recommend deciding what stage (or job within a stage) you want to jump to, add a label before it if there isn't one already, then add a GOTO :label command after the PAUSE.

This may sound a bit involved, but should really only take a minute or two, and given how long Tron can run, is probably worth the effort to do things in a controlled fashion.

Before:

:: JOB: Do stuff
title TRON v%SCRIPT_VERSION% [stage_N_name] [Do some stuff]
call :log "%CUR_DATE% %TIME%    Start doing stuff..."
:: Do some stuff that needs to be done.
echo This is where my actual command would go, IF I HAD ONE!
call :log "%CUR_DATE% %TIME%    Done."


:: JOB: Do more stuff
title TRON v%SCRIPT_VERSION% [stage_N_name] [Do some more stuff]
call :log "%CUR_DATE% %TIME%    Start doing more stuff..."
:: Do some more stuff that needs to be done.
echo This is where the next command would go.
call :log "%CUR_DATE% %TIME%    Done."


:: JOB: Do extra stuff
title TRON v%SCRIPT_VERSION% [stage_N_name] [Do some extra stuff]
call :log "%CUR_DATE% %TIME%    Start doing extra stuff..."
:: Do some extra stuff that needs to be done.
echo This is where my actual command would go.
call :log "%CUR_DATE% %TIME%    Done."

After:

:: JOB: Do stuff
title TRON v%SCRIPT_VERSION% [stage_N_name] [Do some stuff]
call :log "%CUR_DATE% %TIME%    Start doing stuff..."
:: Do some stuff that needs to be done.
echo This is where my actual command would go, IF I HAD ONE!
call :log "%CUR_DATE% %TIME%    Done."
PAUSE
GOTO :job_extra_stuff


:: JOB: Do more stuff
title TRON v%SCRIPT_VERSION% [stage_N_name] [Do some more stuff]
call :log "%CUR_DATE% %TIME%    Start doing more stuff..."
:: Do some more stuff that needs to be done.
echo This is where the next command would go.
call :log "%CUR_DATE% %TIME%    Done."


:job_extra_stuff
:: JOB: Do extra stuff
title TRON v%SCRIPT_VERSION% [stage_N_name] [Do even more stuff]
call :log "%CUR_DATE% %TIME%    Start doing extra stuff..."
:: Do some extra stuff that needs to be done.
echo This is where my actual command would go.
call :log "%CUR_DATE% %TIME%    Done."

You could also just delete the section you don't want to run, though that seems a bit drastic to me.


To automate this, we could use the CHOICE command. CHOICE will give the user a set of options to choose from, and can set a default option after a timeout period. We can let the user choose to

  • continue to next job
  • jump to next stage
  • jump to custom job/stage
  • open a full menu of stage_jobs to jump to

If no choice is made after, say, 30 seconds, Tron would default to continuing on to the next job. As far as I can tell, the choice has to be made during the timeout period, so you can't just hit a key while the current job is running -- you have to wait around for it to finish. There are workarounds to this, but they start to get a bit involved, and this is already pretty long.

If /u/vocatus wants to make (or accept suggestions for) a list of jobs that can be safely skipped, I can write the code.

References:

/r/TronScript Thread Parent