Not sure if this is the best way to do it but it’s working for me. I’d love to not set it every time. @ben any interest in something like this? Happy to fork and PR if so.
1 . The order you check the conditions needs to be reversed i.e. check that the definition does not exist before checking if it’s true.
2. Can you also double check if you need the else statement if you move the exit immediately following the redirect. There’s no point in a redirect to themes if it’s going there anyway.
3. Finally, the white space needs fixing to match the rest of Roots.