@@ -259,7 +259,6 @@ export function padOctal(mode: number): string {
259259 * Create a compressed tar stream of files matching a pattern.
260260 *
261261 * @param filePath Glob pattern for files to include
262- * @param fileName Name of the file in the tar archive
263262 * @param fileContextPath Base directory for resolving file paths
264263 * @param ignorePatterns Ignore patterns to exclude from the archive
265264 * @param resolveSymlinks Whether to follow symbolic links
@@ -291,7 +290,7 @@ export async function tarFileStream(
291290
292291 for ( const file of allFiles ) {
293292 const sourcePath = file . fullpathPosix ( )
294- const targetPath = relativizePath ( sourcePath , fileContextPath )
293+ const targetPath = relativizePath ( filePath )
295294
296295 if ( file . isDirectory ( ) ) {
297296 sources . push ( {
@@ -323,7 +322,7 @@ export async function tarFileStream(
323322/**
324323 * Create a tar stream and calculate its compressed size for upload.
325324 *
326- * @param fileName Glob pattern for files to include
325+ * @param filePath Glob pattern for files to include
327326 * @param fileContextPath Base directory for resolving file paths
328327 * @param resolveSymlinks Whether to follow symbolic links
329328 * @returns Object containing the content length and upload stream
@@ -410,21 +409,9 @@ export function readGCPServiceAccountJSON(
410409 * @param fileContextPath Base directory for resolving relative paths
411410 * @returns Relative path with forward slashes (for tar/cross-platform compatibility)
412411 */
413- export function relativizePath (
414- src : PathLike ,
415- fileContextPath : PathLike
416- ) : string {
417- let rewrittenPath = src . toString ( )
418-
419- // Convert absolute paths to relative paths
420- if ( path . isAbsolute ( rewrittenPath ) ) {
421- const contextPath = path . resolve ( fileContextPath . toString ( ) )
422- const relativePath = path . relative ( contextPath , rewrittenPath )
423- rewrittenPath = relativePath
424- }
425-
412+ export function relativizePath ( src : PathLike ) : string {
426413 // Strip up directories (../ or ..\ on Windows)
427- rewrittenPath = rewrittenPath . replace ( / \. \. ( \/ | \\ ) / g, '' )
414+ const rewrittenPath = src . toString ( ) . replace ( / \. \. ( \/ | \\ ) / g, '' )
428415
429416 // Normalize to forward slashes for cross-platform compatibility (tar archives require forward slashes)
430417 return normalizePath ( rewrittenPath )
0 commit comments