File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
packages/cli/src/config/extensions Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import * as fs from 'node:fs';
1717import * as path from 'node:path' ;
1818import { execSync } from 'node:child_process' ;
1919import { loadExtension } from '../extension.js' ;
20+ import { quote } from 'shell-quote' ;
2021
2122function getGitHubToken ( ) : string | undefined {
2223 return process . env [ 'GITHUB_TOKEN' ] ;
@@ -401,10 +402,12 @@ async function downloadFile(url: string, dest: string): Promise<void> {
401402}
402403
403404function extractFile ( file : string , dest : string ) {
405+ const safeFile = quote ( [ file ] ) ;
406+ const safeDest = quote ( [ dest ] ) ;
404407 if ( file . endsWith ( '.tar.gz' ) ) {
405- execSync ( `tar -xzf ${ file } -C ${ dest } ` ) ;
408+ execSync ( `tar -xzf ${ safeFile } -C ${ safeDest } ` ) ;
406409 } else if ( file . endsWith ( '.zip' ) ) {
407- execSync ( `unzip ${ file } -d ${ dest } ` ) ;
410+ execSync ( `unzip ${ safeFile } -d ${ safeDest } ` ) ;
408411 } else {
409412 throw new Error ( `Unsupported file extension for extraction: ${ file } ` ) ;
410413 }
You can’t perform that action at this time.
0 commit comments