1
0
mirror of https://github.com/Pomax/BezierInfo-2.git synced 2025-09-08 23:50:43 +02:00

deploy script

This commit is contained in:
Pomax
2018-06-24 17:27:09 -07:00
parent 3c378e108c
commit 697afd626a
14 changed files with 66 additions and 26 deletions

21
tools/find-locales.js Normal file
View File

@@ -0,0 +1,21 @@
var glob = require('glob');
var path = require("path");
// make sure we know what our base location is
const BASEDIR = path.join(__dirname,"..");
// find all locales used based on content files
module.exports = function findLocales(handleLocales) {
glob(path.join(BASEDIR,"components/sections/**/content*md"), (err, files) => {
var locales = [];
files.forEach(file => {
let locale = file.match(/content\.([^.]+)\.md/)[1];
if (locales.indexOf(locale) === -1) {
locales.push(locale);
}
});
handleLocales(locales);
});
};