beeper / beepy

Beepy
https://beepy.sqfmi.com
Apache License 2.0
495 stars 37 forks source link

making setup script re-runnable #12

Closed Wgelyjr closed 2 months ago

Wgelyjr commented 1 year ago

just a tiny bit of extra bash

sockbot commented 1 year ago

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.

Wgelyjr commented 1 year ago

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

dezren39 commented 1 year ago

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)