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:
@@ -51,8 +51,11 @@ export class ScriptDownloaderService {
|
||||
}
|
||||
|
||||
modifyScriptContent(content) {
|
||||
// Modify script content for CT scripts if needed
|
||||
return content;
|
||||
// Replace the build.func source line
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user