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

Fix passed an illegal parameter #316

Closed
wants to merge 1 commit into from
Closed

Fix passed an illegal parameter #316

wants to merge 1 commit into from

Conversation

cweijan
Copy link

@cweijan cweijan commented May 26, 2023

Hi, if I pass parameters to openApp, the program will not recognize it, and it will work normally after removing the extra quotes.

@@ -202,7 +202,7 @@ const baseOpen = async options => {
}

if (appArguments.length > 0) {
appArguments = appArguments.map(arg => `"\`"${arg}\`""`);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's double-quoted for a reason. You will have to prove why it's incorrect.

// Double quote with double quotes to ensure the inner quotes are passed through.
// Inner quotes are delimited for PowerShell interpretation with backticks.

@sindresorhus
Copy link
Owner

// @tim-stasse

@cweijan
Copy link
Author

cweijan commented May 26, 2023

Hi, I am making this request because I am using mstsc and below is my code.

import { openApp } from 'open';
const params = ['test.rdp','/v','127.0.0.1:3389']
openApp('mstsc.exe', { arguments: params });

When I execute this code, mstsc doesn't work.

image

After I remove the extra quotes, openApp will work fine.

@cweijan cweijan closed this May 31, 2023
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

Successfully merging this pull request may close these issues.

None yet

2 participants