MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / replaceImport

Function replaceImport

src/plugins/browser/utils/updatePackage.js:16–30  ·  view source on GitHub ↗
(filePath, appName)

Source from the content-addressed store, hash-verified

14const repeatChar = (char, times) => char.repeat(times);
15
16function replaceImport(filePath, appName) {
17 if (!fs.existsSync(filePath)) {
18 console.warn(`⚠ File not found: ${filePath}`);
19 return;
20 }
21
22 const data = fs.readFileSync(filePath, "utf8");
23
24 const updated = data.replace(
25 /(import\s+com\.foxdebug\.)(acode|acodefree)(\.R;)/,
26 `$1${appName}$3`
27 );
28
29 fs.writeFileSync(filePath, updated);
30}
31
32try {
33 if (!fs.existsSync(configXML)) {

Callers 1

updatePackage.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected