Skip to content

Commit 2cd64ea

Browse files
committed
update direcotry pickup
1 parent fef2ca2 commit 2cd64ea

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gatsby-node.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ exports.onCreateNode = ({ node }, pluginOptions) => {
1919
// if regex enabled
2020
if (regex1.test(destination)) {
2121
const hits = regex1.exec(destination)
22-
22+
2323
if (!hits) return
24+
2425
const regPrefix = hits[1]
2526
const regPostfix = hits[2]
2627

27-
const dirList = getDirectories(regPrefix)
28-
28+
const dirList = getDirectories(path.join(process.cwd(), 'public', regPrefix))
29+
2930
dirList.forEach(e => {
30-
const newDestination = regPrefix + '/' + e + regPostfix;
31+
const newDestination = regPrefix + '/' + e + regPostfix;
3132
const newPath = path.join(
3233
process.cwd(),
3334
'public',
3435
newDestination,
3536
relativeToDest,
3637
node.base
3738
);
38-
3939
fsExtra.copy(node.absolutePath, newPath, { overwrite: purge }, err => {
4040
if (err) {
4141
console.error('Error copying file', err);

0 commit comments

Comments
 (0)