XF 2.3 Downgrade addon's build?

asprin

Active member
I ran the build release command on my addon and once the zip file was created (let's say it's v2) I bumped up the version (so now it's v3).

Then I made some changes to some files (controllers, routes, templates etc). But now I realize I want to undo all those changes.

So is there a way to have the source code go back to the v2 version after which I can bump it again and start making fresh changes?
 
That said, once you do revert back to an old version via source control there are commands to run to force XF's internal state back to the old version.

A bash script living in /usr/local/bin/xf-addon-switch-branch with content similar to:
Code:
#!/bin/bash

if [[ "$#" -ne 1 ]]; then
    echo "Require an add-on name"
    exit 1;
fi

if [[ ! -d "src/addons/$1" ]]; then
    echo "Expect src/addons/$1  to exist"
    exit 1;
fi

php cmd.php xf-addon:sync-json "$1" -v -f || exit 1
php cmd.php xf-dev:import --addon="$1" -v || exit 1
php cmd.php xf-dev:metadata-clean -v || exit 1
php cmd.php xf-dev:rebuild-caches -v || exit 1

You can obviously run those by hand, but it is a bit annoying.

I use this sort of script all the time when switching between version branches during development
 
Back
Top Bottom