Rename storage directory

This commit is contained in:
Kamran Ahmed
2020-01-18 22:47:48 +04:00
parent b97ae52a1b
commit a26945288b
72 changed files with 39 additions and 41 deletions

View File

@@ -2,9 +2,9 @@ const fs = require('fs');
const path = require('path');
const exec = require('child_process').execSync;
const STORAGE_PATH = path.join(__dirname, '../storage');
const ROADMAPS_PATH = path.join(__dirname, '../storage/roadmaps');
const META_FILE_PATH = path.join(__dirname, '../storage/roadmaps.json');
const STORAGE_PATH = path.join(__dirname, '../content');
const ROADMAPS_PATH = path.join(__dirname, '../content/roadmaps');
const META_FILE_PATH = path.join(__dirname, '../content/roadmaps.json');
const roadmapDirs = fs.readdirSync(ROADMAPS_PATH);
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 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
// So, we remove it and use the path relative to storage directory
// 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 content directory
const summaryFilePath = path.join(roadmapDir.replace(STORAGE_PATH, ''), '/0-About/0-Summary.md');
const contributors = exec(`git log --pretty=format:"%an%x09" ${roadmapDir} | uniq`)