ZupIT / ritchie-formulas

This repository contains the community formulas that can be executed through Ritchie CLI once imported. This tool is an open source product that allows you to create, store and share any kind of automations, executing them through command lines, to run operations or start workflows ⚙️ 🖥 💡
https://ritchiecli.io
Apache License 2.0
105 stars 72 forks source link

Ritchie doesn't find the $HOME PATH with space #231

Closed lucasdittrichzup closed 3 years ago

lucasdittrichzup commented 4 years ago

What happened:

Screen Shot 2020-08-14 at 18 00 45

What you expected to happen:

I expected Ritchie to find the correct path

How to reproduce it (as minimally and precisely as possible):

rit demo hello-world

Anything else we need to know?:

Environment:

GuillaumeFalourd commented 4 years ago

After analyzing the request, the problem lies in the formula scripts, specifically in that part:

build.bat file

echo SET mypath=%%~dp0 >> %BAT_FILE%
echo start /B /WAIT %%mypath:~0,-1%%/windows/main.exe >> %BAT_FILE%

In the tests performed, for the binary to run successfully for "composite users" (eg Dennis Ritchie) on Windows, the code above should be:

echo SET mypath=%%~dp0 >> %BAT_FILE%                      # Remove that line
echo start /B /WAIT windows/main.exe >> %BAT_FILE%        # Removed part: '%%mypath:~0,-1%%/'
MadhavJivrajani commented 4 years ago

Hi! Can I work on this?

GuillaumeFalourd commented 4 years ago

Sure, I've assigned it to you @MadhavJivrajani Thank you for contributing ! 👍

MadhavJivrajani commented 4 years ago

Hi @guilhermefsantoszup, Thank you for assigning this issue to me, however, I asked for this assignment in haste, I don't have Windows on my system. If I can make changes and contribute according to what you suggested above then I'd love to work on this! If not then it would be better to unassign me and let someone else work on this. I'm so sorry for the confusion caused.

GuillaumeFalourd commented 4 years ago

Yes, in fact, the best solution would be to validate the implementation locally before submitting the contribution. After all, it may be necessary to update another part of the code related to the suggestion above.

But don't worry, you can work on another issue and release this one @MadhavJivrajani

resmall commented 4 years ago

Hey can I take this one?

GuillaumeFalourd commented 4 years ago

Hi @resmall ! Sure, I'll assign it to you 👍🏼 Thank you for contributing, feel free to ask any question 😄

resmall commented 4 years ago

Hello! I've just taken a look at it, I've tested it with with go, node and http-config on windows, all showed the same path problem message.

I've just made that suggested change in my local code and it started working. So from what I understand I'll have to remove all occurrences of %%mypath:~0,-1%%/ and delete the line echo SET mypath=%%~dp0 >> %BAT_FILE%, is that correct?

Also, wouldn't we need to fix this issue in https://github.com/resmall/ritchie-formulas-demo as well?

Thank you!

GuillaumeFalourd commented 4 years ago

Hi @resmall , thank you for your message 👍🏼 Your observations are correct. All occurrences will have to be updated, and on both repositories.

fabianofernandeszup commented 3 years ago

Solved