@@ -570,6 +570,21 @@ protected function unzipWithStrip(string $zip_file, string $extract_path): void
570570 FileSystem::removeDir ($ temp_dir );
571571 }
572572
573+ /**
574+ * Replace path variables.
575+ */
576+ protected function replacePathVariables (string $ path ): string
577+ {
578+ $ replacement = [
579+ '{pkg_root_path} ' => PKG_ROOT_PATH ,
580+ '{build_root_path} ' => BUILD_ROOT_PATH ,
581+ '{source_path} ' => SOURCE_PATH ,
582+ '{download_path} ' => DOWNLOAD_PATH ,
583+ '{working_dir} ' => WORKING_DIR ,
584+ ];
585+ return str_replace (array_keys ($ replacement ), array_values ($ replacement ), $ path );
586+ }
587+
573588 /**
574589 * Move file or directory, handling cross-device scenarios
575590 * Uses rename() if possible, falls back to copy+delete for cross-device moves
@@ -608,21 +623,6 @@ private static function moveFileOrDir(string $source, string $dest): void
608623 }
609624 }
610625
611- /**
612- * Replace path variables.
613- */
614- protected function replacePathVariables (string $ path ): string
615- {
616- $ replacement = [
617- '{pkg_root_path} ' => PKG_ROOT_PATH ,
618- '{build_root_path} ' => BUILD_ROOT_PATH ,
619- '{source_path} ' => SOURCE_PATH ,
620- '{download_path} ' => DOWNLOAD_PATH ,
621- '{working_dir} ' => WORKING_DIR ,
622- ];
623- return str_replace (array_keys ($ replacement ), array_values ($ replacement ), $ path );
624- }
625-
626626 private function copyFile (string $ source_file , string $ target_path ): void
627627 {
628628 FileSystem::createDir (dirname ($ target_path ));
0 commit comments