-
-
Notifications
You must be signed in to change notification settings - Fork 182
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/defaultTargets_updating #1782
Conversation
On android platforms (android, androidTV, androidwear, firetv) rnv asks ->
On ios and tvos ->
Note: On webos -> didn't ask to choose target (I have only one webos simulator installed)
Is it expected that android target is set on global but ios you could choose? |
return true; | ||
} else { | ||
await executeAsync( | ||
`${c.cli[CLI_TIZEN_EMULATOR]} launch --name ${name}`, |
Check warning
Code scanning / CodeQL
Unsafe shell command constructed from library input Medium
library input
shell command
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI about 1 month ago
To fix the problem, we should avoid constructing the shell command using string concatenation with untrusted input. Instead, we can use the child_process.execFile
method, which allows us to pass arguments as an array, thus avoiding shell interpretation of the input.
- Replace the use of
executeAsync
withexecFile
from thechild_process
module. - Ensure that the
name
parameter is passed as an argument in the array format toexecFile
.
-
Copy modified lines R140-R149
@@ -139,6 +139,12 @@ | ||
} else { | ||
await executeAsync( | ||
`${c.cli[CLI_TIZEN_EMULATOR]} launch --name ${name}`, | ||
ExecOptionsPresets.SPINNER_FULL_ERROR_SUMMARY | ||
); | ||
const { execFile } = require('child_process'); | ||
await new Promise((resolve, reject) => { | ||
execFile(c.cli[CLI_TIZEN_EMULATOR], ['launch', '--name', name], ExecOptionsPresets.SPINNER_FULL_ERROR_SUMMARY, (error, stdout, stderr) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(stdout); | ||
} | ||
}); | ||
}); | ||
return true; |
NOTE: project/global default target updates like this -> Tizenwatch -> works as expected. |
on mac both tizen and tizenwatch work as expected |
windows
NOTE - project/global default target updates correctly macOS -> |
Not implemented on kaios |
Description
Related issues
Npm releases
n/a