Skip to content

Commit

Permalink
Fix symbolic link support in .
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark committed Jul 14, 2024
1 parent ce3e06c commit b9d69e1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions bin/pack-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function packDirectory(root, urlRoot, genRoot, dirPath = '', indent = 0) {
for (const file of files) {
packedData.push(`${' '.repeat(indent + 1)}${JSON.stringify(file.name)}: `);
const filePath = `${dirPath}/${file.name}`;
if (file.isDirectory()) {
if (file.isDirectory() || file.isSymbolicLink()) {
packedData.push(await packDirectory(root, urlRoot, genRoot, filePath, indent + 1));
} else if (file.isFile()) {
const fileData = await readFile(`${root}/${filePath}`);
Expand All @@ -45,9 +45,6 @@ async function packDirectory(root, urlRoot, genRoot, dirPath = '', indent = 0) {
await writeFile(`${genRoot}/${urlRoot}/${filePath}`, fileData);
packedData.push(`new URL(${JSON.stringify(urlRoot + filePath)}, import.meta.url)`);
}
} else if (file.isSymbolicLink()) {
const linkPath = await readlink(`${root}/${filePath}`);
packedData.push(await packDirectory(root, urlRoot, genRoot, linkPath, indent + 1));
} else {
packedData.push('null');
}
Expand Down

0 comments on commit b9d69e1

Please sign in to comment.