I've just added a check before calling recursivePurge in switchAction (to check that action.share is enabled),
so i'm checking once per repo (not once per file)