Fix CT script source line replacement

- Implement modifyScriptContent method to replace GitHub source line with local source
- Replace 'source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)'
  with 'SCRIPT_DIR="." \nsource "/../core/build.func"'
- This ensures CT scripts use local build.func instead of downloading from GitHub
- Applied to all CT scripts during download process
- Tested with 2fauth script - replacement works correctly
This commit is contained in:
Michel Roegl-Brunner
2025-10-24 22:04:23 +02:00
parent 6c982050da
commit e40bd1f6a3

View File

@@ -51,8 +51,11 @@ export class ScriptDownloaderService {
} }
modifyScriptContent(content) { modifyScriptContent(content) {
// Modify script content for CT scripts if needed // Replace the build.func source line
return content; const oldPattern = /source <\(curl -fsSL https:\/\/raw\.githubusercontent\.com\/community-scripts\/ProxmoxVE\/main\/misc\/build\.func\)/g;
const newPattern = 'SCRIPT_DIR="$(dirname "$0")" \nsource "$SCRIPT_DIR/../core/build.func"';
return content.replace(oldPattern, newPattern);
} }
async loadScript(script) { async loadScript(script) {