-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca031c9
commit b4d09b5
Showing
5 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* eslint-disable github/array-foreach */ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
/* eslint-disable @typescript-eslint/no-require-imports */ | ||
const fs = require('fs-extra'); | ||
const path = require('path'); | ||
|
||
function fixPackagePath(sourceDir) { | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
fs.readdirSync(sourceDir).forEach((file) => { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument | ||
const filePath = path.join(sourceDir, file); | ||
if (fs.statSync(filePath).isDirectory()) { | ||
fixPackagePath(filePath); | ||
} else if (filePath.endsWith('.xml') || filePath.endsWith('.brs') || filePath.endsWith('.d.bs')) { | ||
let text = fs.readFileSync(filePath, 'utf8'); | ||
let r = /\/roku_modules\/undefined\/bslib/gim; | ||
text = text.replace( | ||
r, | ||
'/roku_modules/rokucommunity_bslib/bslib' | ||
); | ||
r = /\/roku_modules\/undefined/gim; | ||
text = text.replace(r, '/roku_modules/maestro'); | ||
|
||
fs.writeFileSync(filePath, text); | ||
} | ||
}); | ||
} catch (e) { } | ||
} | ||
|
||
let sourceDir = path.join(__dirname, '..', 'src', 'components', 'roku_modules'); | ||
fixPackagePath(sourceDir); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters