curiosity-ai / h5

🚀 The next generation C# to JavaScript compiler

Home Page:https://h5.rocks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for local tools.

IceReaper opened this issue · comments

https://docs.microsoft.com/en-us/dotnet/core/tools/local-tools-how-to-use

When installing h5-compiler with this approach, compiling fails with

       _CheckForH5:
         h5 check-if-online
         'h5' is not recognized as an internal or external command,
         operable program or batch file.

Running "h5" from cmd obviously does not work. "dotnet h5" however works when installing localy. Would it be an option to change the manual system calls which the build process does to "dotnet h5" instead of "h5"? This way we could avoid the need to install h5 globally and allow people to build without doing anything before.

Hi @IceReaper - I could add a flag to enable that, but would require some testing... what's the issue with installing it globally that you hit?

Its not really an issue, but it happened multiple times now, where other employees reinstalled some dotnet stuff, or simply updated the sdk, and were suddenly unable to build due to the missing h5 compiler installation. If it would work with the local tools approach too, we would completely get rid of that problem as it would always work. This also applies to build servers where some admin has updated the installed sdk. Otherwise people need to remember this step and/or keep investing time to find the solution in this projects readme.
So not really an issue or bug, but its definitely more user-friendly then :)

@IceReaper I've added this option now. If you don't have the h5 global tool it will try to detect it as a local, or you can fully bypass this by defining on your project file:

<PropertyGroup>
    <UseLocalH5>true</UseLocalH5>
</PropertyGroup>

For future reference, to install h5 as a local tool in a given project, you can run this from the command line in the folder of the project:

dotnet new tool-manifest
dotnet tool install --local h5-compiler