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

[BUG] FunctionCliResolver unable to handle spaces in the path #1437

Closed
thomasmillercf opened this issue Sep 22, 2022 · 1 comment
Closed

Comments

@thomasmillercf
Copy link

Describe the bug
FunctionCliResolver is unable to handle spaces in the path. Found this out due to WSL adding a bunch windows PATH on the end of the ubuntu PATH. Then an expectation is return which is not very clear

To Reproduce
Using WSL: Ubuntu

Install Func tools
export PATH=$PATH:some path with spaces

Code Snippet

 val cliExec = FunctionCliResolver.resolveFunc();
        if (StringUtils.isEmpty(cliExec)) {
            throw RuntimeException("dead");
        }

Expected behavior
It should either be able to handle spaces and return me the path to the func tools.

Looking into the code, why is the PATH even being modified? As i personally think this is a hack. As if the PATH was not being modified there would not be a issue

CommandUtils.class

        final String commandWithPath = isWindows() ? commandWithArgs : String.format("export PATH=$PATH:/usr/local/bin ; %s", commandWithArgs);

Work Around
In my env make sure i have no spaces in the path.

@weidongxu-microsoft
Copy link
Member

there is no FunctionCliResolver in this lib?

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

2 participants