Fix debugger

This commit is contained in:
Brahim Hadriche committed 2023-02-04 11:30:35 -05:00
1 parent 9dcfd20c57
commit 0bd05cdba6
4 files changed
+18 -7

No files matched your search

+2
View File
@@ -4,6 +4,7 @@ import {
} from 'brighterscript';
import path from 'path';
import fs from 'fs';
const ip = require('ip');
export class ManifestBsConstDebugPlugin implements CompilerPlugin {
public name = 'manifestBsConstDebugPlugin';
@@ -20,6 +21,7 @@ export class ManifestBsConstDebugPlugin implements CompilerPlugin {
const manifestPath = path.join(builder.options.rootDir!, "manifest")
this.originalManifestContent = fs.readFileSync(manifestPath, { encoding: 'utf8', flag: 'r' })
let manifestContent = this.originalManifestContent.replace(/DEBUG=(true|false)/i, `DEBUG=${value}`);
manifestContent = manifestContent.replace(/DEBUG_HOST_IP_ADDRESS/i, `${ip.address()}`)
fs.writeFileSync(manifestPath, manifestContent)
}