|
|
@ -2,9 +2,9 @@ const fs = require('fs'); |
|
|
|
const path = require('path'); |
|
|
|
const path = require('path'); |
|
|
|
const exec = require('child_process').execSync; |
|
|
|
const exec = require('child_process').execSync; |
|
|
|
|
|
|
|
|
|
|
|
const STORAGE_PATH = path.join(__dirname, '../storage'); |
|
|
|
const STORAGE_PATH = path.join(__dirname, '../content'); |
|
|
|
const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps'); |
|
|
|
const ROADMAPS_PATH = path.join(__dirname, '../content/roadmaps'); |
|
|
|
const META_FILE_PATH = path.join(__dirname, '../storage/roadmaps.json'); |
|
|
|
const META_FILE_PATH = path.join(__dirname, '../content/roadmaps.json'); |
|
|
|
|
|
|
|
|
|
|
|
const roadmapDirs = fs.readdirSync(ROADMAPS_PATH); |
|
|
|
const roadmapDirs = fs.readdirSync(ROADMAPS_PATH); |
|
|
|
console.log(`[x] ${roadmapDirs.length} roadmaps found`); |
|
|
|
console.log(`[x] ${roadmapDirs.length} roadmaps found`); |
|
|
@ -14,8 +14,8 @@ const roadmapsMeta = roadmapDirs.reduce((metaAcc, roadmapDirName) => { |
|
|
|
const roadmapDir = path.join(ROADMAPS_PATH, roadmapDirName); |
|
|
|
const roadmapDir = path.join(ROADMAPS_PATH, roadmapDirName); |
|
|
|
const roadmapMeta = require(path.join(roadmapDir, 'meta.json')); |
|
|
|
const roadmapMeta = require(path.join(roadmapDir, 'meta.json')); |
|
|
|
|
|
|
|
|
|
|
|
// We can't use the absolute path in the build e.g. ~/Users/user/where-build-is-running/storage
|
|
|
|
// We can't use the absolute path in the build e.g. ~/Users/user/where-build-is-running/content
|
|
|
|
// So, we remove it and use the path relative to storage directory
|
|
|
|
// So, we remove it and use the path relative to content directory
|
|
|
|
const summaryFilePath = path.join(roadmapDir.replace(STORAGE_PATH, ''), '/0-About/0-Summary.md'); |
|
|
|
const summaryFilePath = path.join(roadmapDir.replace(STORAGE_PATH, ''), '/0-About/0-Summary.md'); |
|
|
|
|
|
|
|
|
|
|
|
const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`) |
|
|
|
const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`) |
|
|
|