Justman10000 while I see the usefulness this script can have when bootstrapping a new forum, I feel obligated to post some warnings to anyone who would use this script or any similar script:
It's not clearly stated in the README, but running the provided command will delete any existing extension installed on the forum (not its data though, so it can be re-installed later).
If the forum is using external Composer repositories those will be deleted as well (like Extiverse).
I would strongly suggest using a ^
requirement on Flarum core, because it will allow installing security and feature updates using the official upgrade guide and avoid downgrading any forum that runs your command if we release a security patch in the meantime.
COMPOSER_ALLOW_SUPERUSER=1
and using Composer as root in general should be avoided whenever possible and only used as a last resort when a sysadmin knows what they are doing. So I would not include this in any official instruction. It can be added back by the sysadmins as needed. I see this might be relevant when using Docker but in general it's a sign of bad practice.
The script as it currently stands could be simply converted into a very long single Composer command. This would avoid the problem of uninstalling existing extensions, repositories or causing downgrades, as well as throw any platform compatibility error before composer.json
gets modified.