Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on how to install tool locally #62

Open
Skrypt opened this issue Nov 16, 2022 · 13 comments
Open

Add documentation on how to install tool locally #62

Skrypt opened this issue Nov 16, 2022 · 13 comments

Comments

@Skrypt
Copy link
Contributor

Skrypt commented Nov 16, 2022

You need to do a Dotnet Pack on the PoExtractor.OrchardCore or the PoExtractor projects.
Then you need to do:

extractpo

dotnet tool install --global --add-source {{PathToYourRepository}}\OrchardCoreContrib.PoExtractor\src\OrchardCoreContrib.PoExtractor\bin\Debug OrchardCoreContrib.PoExtractor --version 1.0.1

This needs to be documented so that when we develop we can use it locally.

@hishamco
Copy link
Member

hishamco commented Dec 4, 2022

Is it to avoid adding a unit test for a certain use case or is there a use case to create a package locally?

@Skrypt
Copy link
Contributor Author

Skrypt commented Dec 5, 2022

When debugging this tool while fixing it.

@hishamco
Copy link
Member

hishamco commented Dec 5, 2022

I'm usually run the donet run from CLI to test any added feature

@rjpowers10
Copy link

I'm usually run the donet run from CLI to test any added feature

I'm also confused by the issue. Should be able to debug the tool like any other .NET application (e.g. dotnet run or launch from Visual Studio).

@Skrypt
Copy link
Contributor Author

Skrypt commented Dec 13, 2023

This is what I'm doing.

dotnet run on the OrchardCoreContrib.PoExtractor folder but I get an exception when trying to execute extractpo

image

So I need to install the extractor tool from the local Nuget package which doesn't make any sense.

@hishamco
Copy link
Member

Why do you need the extractpo inside the repo folder?!!

@Skrypt
Copy link
Contributor Author

Skrypt commented Jan 3, 2024

@hishamco What I'm trying to do here is execute extractpo inside a command.ps1 file. So, either I'm moving that command.ps1 file to the repository folder or I need to reinstall the tool from the local source code folder. Running it from Visual Studio is not registering this tool as a global command shell available script. You need to install it first. This is what I'm explaining here with my different tests and showing you screenshots of the results.

@hishamco
Copy link
Member

hishamco commented Jan 3, 2024

What I'm trying to do here is execute extractpo inside a command.ps1 file

I didn't understand which command.ps1 are you referring to.

@Skrypt
Copy link
Contributor Author

Skrypt commented Jan 3, 2024

Nothing that comes with the source code here. It is a custom script that I wrote that uses Google Translate to generate PO files for each cultures with translated strings. I run this script manually periodically to translate everything. So, if I want to debug it, I need to install the tool from source code locally. Running the OrchardCoreContrib.PoExtractor project doesn't work for me for doing that. Else, I need to change all of my script paths. I understand that you can run extractpo when running the project but then the paths are all relative to that folder which is not really helpful at all.

In the end, if it needs to execute from CI it needs to use the installed Nuget package tool.

@hishamco
Copy link
Member

hishamco commented Jan 3, 2024

I understand that you can run extractpo when running the project but then the paths are all relative to that folder which is not really helpful at all.

Strange!! could you please share the script if it's fine for you or give me steps to reproduce the issue, I remember that I extracted one project resources from the source but I will have another try

@Skrypt
Copy link
Contributor Author

Skrypt commented Jan 3, 2024

I will share it at some point in a different PR but that's not the point. The issue is that when you are running the solution it doesn't register the tool globally to be used. You can see it in the screenshot I sent you. That's the Visual Studio powershell instanciated when running the project locally. Doing extractpo fails.

Actually don't want to digress into that topic but we could easily add a translate option to this tool. But, the script I made needs to be rewritten in C#. Which is something anyone could do.

extractpo -t "en,fr"

@hishamco
Copy link
Member

hishamco commented Jan 3, 2024

I understand what you mean, you need to use OrchardCoreContrib.PoExtractor instead of extractpo

@Skrypt
Copy link
Contributor Author

Skrypt commented Jan 3, 2024

Thanks, I will try that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants