Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ function getComposerURI(webView: Webview): string {
function getComposerCSSFiles(disableComDebug: boolean, devHost: string, webView: Webview): string[] {
const filePath = join((extension.ballerinaExtInstance.context as ExtensionContext).extensionPath, 'resources', 'jslibs', 'themes', 'ballerina-default.min.css');
return [
(isDevMode && !disableComDebug) ? join(devHost, 'themes', 'ballerina-default.min.css')
(isDevMode && !disableComDebug) ? new URL('themes/ballerina-default.min.css', devHost).toString()
: webView.asWebviewUri(Uri.file(filePath)).toString()
];
}

function getComposerJSFiles(componentName: string, disableComDebug: boolean, devHost: string, webView: Webview): string[] {
const filePath = join((extension.ballerinaExtInstance.context as ExtensionContext).extensionPath, 'resources', 'jslibs') + sep + componentName + '.js';
return [
(isDevMode && !disableComDebug) ? join(devHost, componentName + '.js')
(isDevMode && !disableComDebug) ? new URL(componentName + '.js', devHost).toString()
: webView.asWebviewUri(Uri.file(filePath)).toString(),
isDevMode ? 'http://localhost:8097' : '' // For React Dev Tools
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function extractBinary(archivePath, platform, destDir) {

try {
if (platform.ext === '.tar.gz') {
execSync(`tar -xzf '${archivePath}' -C '${tmpExtractDir}'`, { stdio: 'inherit' });
execSync(`tar -xzf "${archivePath}" -C "${tmpExtractDir}"`, { stdio: 'inherit' });
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Using execSync with interpolated paths can break when archivePath or tmpExtractDir contains double quotes, and it also increases command-injection risk if those values are ever influenced externally. Prefer execFileSync('tar', ['-xzf', archivePath, '-C', tmpExtractDir], { stdio: 'inherit' }) (or spawnSync) to avoid shell parsing/quoting issues entirely.

Copilot uses AI. Check for mistakes.
} else if (platform.ext === '.zip') {
if (os.platform() === 'win32') {
execSync(`powershell.exe -Command "Expand-Archive -Path '${archivePath}' -DestinationPath '${tmpExtractDir}' -Force"`, { stdio: 'inherit' });
Expand Down
Loading