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

Can't use ampersand. #49

Open
DeepSeaPlain opened this issue Aug 31, 2023 · 8 comments
Open

Can't use ampersand. #49

DeepSeaPlain opened this issue Aug 31, 2023 · 8 comments
Labels
bug Something isn't working waiting for response

Comments

@DeepSeaPlain
Copy link

DeepSeaPlain commented Aug 31, 2023

I am trying to copy a URL to a config file and the "&" character and everything behind it gets cut off.
Example URL: https://example.com/data/?id=6969&token=1A2B3C4D5E6F7G8H9

"--usedUrl=https://example.com/data/?id=6969&token=1A2B3C4D5E6F7G8H9"

The result is: https://example.com/data/?id=6969 and he rest behind it is missing.

I have tried using \& \\& wrapping the entire URL in "https://example.com/data/?id=6969&token=1A2B3C4D5E6F7G8H9\" and many combinations of it.

@TatsuUkraine TatsuUkraine added the bug Something isn't working label Aug 31, 2023
@TatsuUkraine
Copy link
Owner

Hello, thank you for report, I will take a look what is going on as soon as I get free)

@TatsuUkraine
Copy link
Owner

You generating dart class or .env file?

@DeepSeaPlain
Copy link
Author

@TatsuUkraine I'm generating a dart class.

@TatsuUkraine
Copy link
Owner

@DeepSeaPlain what OS are you using? I tried to run command with your value in the example project and all works

@DeepSeaPlain
Copy link
Author

DeepSeaPlain commented Sep 5, 2023

My Platform is Windows.
I'm using a yaml file to generate a dart class.

var arguments = [
'pub',
'run',
'environment_config:generate',
'--config=some_config.yaml',
'--var1=${package.var1}',
'--var2=${package.var2}',
'--var3=${package.var3}',
];

Im using the command:

Process.runSync(
'flutter.bat',
arguments,
runInShell: false,
);

It gets cut off when im running it with Proccess.runSync()

@TatsuUkraine
Copy link
Owner

Ok, I will try to create shell file. Could you try to run generate command straight from the terminal? I'm just thinking that it may not necessary related to the package, but simply because something happens with the value when you passing it in *.bat file.

@TatsuUkraine
Copy link
Owner

Maybe you need to encode URI string before you passing it in bat file? It's just an assumption, since I don't have windows to check if it works(

@TatsuUkraine
Copy link
Owner

Another option probably (if you didn't try it yet), wrap value with quotes

var arguments = [
'pub',
'run',
'environment_config:generate',
'--config=some_config.yaml',
'--var1="${package.var1}"',
'--var2="${package.var2}"',
'--var3="${package.var3}"',
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for response
Projects
None yet
Development

No branches or pull requests

2 participants