forked from Fediversity/Fediversity
Valentin Gagarin
e41e0daa82
git-subtree-dir: website git-subtree-mainline:83b1c9ac3b
git-subtree-split:d208ee83f8
20 lines
623 B
JavaScript
20 lines
623 B
JavaScript
const { exec } = require("child_process");
|
|
|
|
const repositoryUrl = "https://github.com/zeon-studio/hugoplate";
|
|
const localDirectory = "./themes/hugoplate";
|
|
const foldersToFetch = ["assets", "layouts"];
|
|
const foldersToSkip = ["exampleSite"];
|
|
|
|
const fetchFolder = (folder) => {
|
|
exec(
|
|
`curl -L ${repositoryUrl}/tarball/main | tar -xz --strip-components=1 --directory=${localDirectory} --exclude=$(curl -sL ${repositoryUrl}/tarball/main | tar -tz | grep -E "/(${foldersToSkip.join(
|
|
"|",
|
|
)})/") */${folder}`,
|
|
);
|
|
};
|
|
|
|
// Fetch each specified folder
|
|
foldersToFetch.forEach((folder) => {
|
|
fetchFolder(folder);
|
|
});
|