Fixed build.json no longer including root files

Jaxel

Well-known member
Affected version
2.1
In one of my addons, this is my build.json:
Code:
{
    "additional_files": [
        "js/8wayrun/discord",
        "connected_discord.php"
    ]
}

Naturally, this includes my JS folder. It also includes a file in the XF root called connected_discord.php.

However, in XF2.1, building the addon does not include the connected_discord.php file.
 
Actually, its worse than that...

The contents of connected_discord.php have been placed into js/8wayrun/discord/discord.js... which means my JS was wiped out.
 
Okay, I now believe the entire build.json procedure is messed up.

In another one of my addons, this is my build.json:
Code:
{
    "additional_files": [
        "js/8wayrun/rio",
        "styles/8wayrun/rio/_channel.jpg",
        "styles/8wayrun/rio/_game.jpg",
        "styles/8wayrun/rio/_offline.jpg"
    ],
    "minify": "*"
}

The build procedure is placing the contents of one of the .jpg files into one of my JS files... which of course leads to errors.
 
Have you tried
Code:
"additional_files": [
    "js/8wayrun/rio",
    "styles/8wayrun/rio/"
],


Fillip
Yes, that worked. However, that also includes files that I DON'T want in the package.
That's why I said this bug seems related to defining specific files, instead of just directories.
 
Thank you for reporting this issue. The issue is now resolved and we are aiming to include that in a future XF release (2.1.0 Beta 3).

Change log:
fix copying individual files in the additional_files portion of the add-on build process
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
Last edited by a moderator:
This is a simple fix if you want to test it. In src/XF/Service/AddOn/ReleaseBuilder.php, change:

Code:
$stdPath = File::stripRootPathPrefix($file->getPathname(), $root);

to:

Code:
$stdPath = File::stripRootPathPrefix($filePath, $root);
 
Top Bottom