Extraction des secrets
This commit is contained in:
@@ -21,18 +21,13 @@ const fsSync = require('fs');
|
||||
const path = require('path');
|
||||
const https = require('https');
|
||||
const readline = require('readline');
|
||||
const { loadToolsConfig } = require('./lib/config');
|
||||
|
||||
const ROOT = process.cwd();
|
||||
const LEGO_ROOT = path.join(ROOT, 'content', 'collections', 'lego');
|
||||
const CONFIG_PATH = path.join(ROOT, 'tools', 'config.json');
|
||||
const CACHE_ROOT = path.join(ROOT, 'tools', 'cache', 'rebrickable');
|
||||
const ONE_WEEK_MS = 7 * 24 * 60 * 60 * 1000;
|
||||
|
||||
function loadConfig() {
|
||||
const raw = fsSync.readFileSync(CONFIG_PATH, 'utf8');
|
||||
return JSON.parse(raw);
|
||||
}
|
||||
|
||||
function slugify(input) {
|
||||
return input
|
||||
.normalize('NFD')
|
||||
@@ -222,7 +217,7 @@ async function main() {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const config = loadConfig();
|
||||
const config = await loadToolsConfig();
|
||||
const apiKey = config.rebrickable.apiKey;
|
||||
const host = 'rebrickable.com';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user