Skip to content

Commit

Permalink
collect images from folder
Browse files Browse the repository at this point in the history
  • Loading branch information
tsonevn committed Oct 2, 2018
1 parent 8a02bcb commit ac8ec60
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,14 @@ function getComponents(cwd, components, currentDir, jenkinsPosition) {

fs.appendFileSync(componentArticleFile, "![Image](img/" + newArticleImageFileName + " \"Image\")\n\n", {encoding:'utf8'});
}

let articleImages = glob.sync(articleDirName + "/*.png");
articleImages.forEach(function(imagePath){
let stringSplitResult = imagePath.split("/");
let imageName = stringSplitResult[stringSplitResult.length - 1];
let joined = path.join(imgDir, imageName);
fs.copySync(imagePath, joined);
})

// Links
var githubDirUrl = pjson.homepage + "/edit/master/" + path.relative(cwd, articleDirName).replace(/\\/g, "/");

Expand Down

0 comments on commit ac8ec60

Please sign in to comment.