beepy icon indicating copy to clipboard operation
beepy copied to clipboard

making setup script re-runnable

Open Wgelyjr opened this issue 1 year ago • 3 comments

just a tiny bit of extra bash

Wgelyjr avatar Jun 19 '23 17:06 Wgelyjr

What if instead of checking for the existence of a previous setup attempt, the setup script cleaned up after itself instead? i.e. the script should delete its temporary directories and leave the home dir in the same state as before it was run.

sockbot avatar Aug 03 '23 00:08 sockbot

I've changed the script to clean out the directories on failure and before exit. Haven't tested it so it's probably riddled with syntax errors

Wgelyjr avatar Aug 03 '23 17:08 Wgelyjr

i think you will want to run cleanup at the beginning, regardless.

this will handle if the script fails or the user hits ctrl+c or a power outage etc.

there are still remaining files that could be a hazard, as-is.

even using a trap won't handle all scenarios. (trap may have been a bit more reliable or less tedious for you to setup than this way in some ways, but mostly equivalent with it's own issues)

dezren39 avatar Aug 28 '23 00:08 dezren39