fix(mod_output): resolve absolute and relative entry.path correctly when adding files
This commit is contained in:
@@ -56,7 +56,10 @@ export class Base64TsOutput {
|
||||
|
||||
for (const entry of entries) {
|
||||
if (!entry.isDirectory && regex.test(entry.name)) {
|
||||
const fullPath = plugins.path.join(dirPath, entry.path);
|
||||
// entry.path may be absolute or relative - handle both cases
|
||||
const fullPath = plugins.path.isAbsolute(entry.path)
|
||||
? entry.path
|
||||
: plugins.path.join(dirPath, entry.path);
|
||||
const relativePath = plugins.path.relative(this.cwd, fullPath);
|
||||
const content = await plugins.fs.file(fullPath).read();
|
||||
this.addFile(relativePath, content);
|
||||
|
||||
Reference in New Issue
Block a user