From a4b218a88f9737696d09eaf4a93888f1284b3cf5 Mon Sep 17 00:00:00 2001 From: Sarabveer Singh Date: Sun, 31 Dec 2023 23:14:39 -0500 Subject: [PATCH] chore: move sources list to data folder --- lib/backport.js | 2 +- lib/build-database.js | 1 - lib/build-gutka.js | 2 +- lib/build-json.js | 1 + lib/utils.js | 17 ----------------- 5 files changed, 3 insertions(+), 20 deletions(-) diff --git a/lib/backport.js b/lib/backport.js index 35d993e04..4284bbeea 100644 --- a/lib/backport.js +++ b/lib/backport.js @@ -8,7 +8,7 @@ */ require( './string-colors' ) -const { GURMUKHI_SOURCES } = require( './utils' ) +const GURMUKHI_SOURCES = require( '../data/sourcesList' ) const { resolve } = require( 'path' ) const { readFile, readdir, rename, unlink, writeFile } = require( 'fs/promises' ) diff --git a/lib/build-database.js b/lib/build-database.js index 99795db99..520155957 100644 --- a/lib/build-database.js +++ b/lib/build-database.js @@ -486,7 +486,6 @@ const importBanis = async trx => { const setGitRevision = async knex => { console.log( '\nSetting git revision'.subheader ) - console.log( JSON_PATH ) const commitSHA = require( 'child_process' ) .execSync( 'git rev-parse HEAD', { cwd: JSON_PATH } ) .toString() diff --git a/lib/build-gutka.js b/lib/build-gutka.js index 8d1798d6e..de9673a59 100644 --- a/lib/build-gutka.js +++ b/lib/build-gutka.js @@ -1,5 +1,5 @@ require( './string-colors' ) -const { GURMUKHI_SOURCES } = require( './utils' ) +const GURMUKHI_SOURCES = require( '../data/sourcesList' ) const build = require( './build-database' ) const { filename } = require( '..' ) const fs = require( 'fs' ) diff --git a/lib/build-json.js b/lib/build-json.js index 909dd803e..03b749a24 100644 --- a/lib/build-json.js +++ b/lib/build-json.js @@ -298,6 +298,7 @@ const main = async () => { await fsCopy( `${OUTPUT_DIR}/.git`, `${TMP_DIR}/.git` ) await fsCopy( `${OUTPUT_DIR}/.github`, `${TMP_DIR}/.github` ) await fsCopy( `${OUTPUT_DIR}/README.md`, `${TMP_DIR}/README.md` ) + await fsCopy( `${OUTPUT_DIR}/sourcesList.js`, `${TMP_DIR}/sourcesList.js` ) await rimraf( OUTPUT_DIR ) renameSync( TMP_DIR, OUTPUT_DIR ) diff --git a/lib/utils.js b/lib/utils.js index 4924d8d83..0d33618aa 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -82,24 +82,7 @@ const larivaar = input => input .replace( /\s+\u200B/ug, ' ' ) .replace( /\u200B\s+/ug, ' ' ) -// Gurmukhi sources with fallback ordering -const GURMUKHI_SOURCES = { - Ardaas: [ 'SGPC' ], - 'Ganj Nama Bhai Nand Lal Ji': [ 'Master Jaswant Singh', 'Dr. Ganda Singh' ], - 'Ghazals Bhai Nand Lal Ji': [ 'Dr. Ganda Singh' ], - 'Jot Bigas Bhai Nand Lal Ji': [ 'Dr. Ganda Singh' ], - 'Kabit Savaiye Bhai Gurdas Ji': [ 'Seva Singh' ], - 'Sarabloh Granth': [ 'Amrit Keertan' ], - 'Sri Dasam Granth': [ 'GurbaniNow', 'Master Jaswant Singh', 'Bhai Joginder Singh Talwara', 'Bhai Kulbir Singh', 'SGPC', 'Piara Singh Padam', 'Dr. Rattan Singh Jaggi' ], - 'Sri Guru Granth Sahib Ji': [ 'GurbaniNow', 'Bhai Sahib Randhir Singh', 'Master Jaswant Singh', 'Bhai Joginder Singh Talwara', 'Bhai Kulbir Singh', 'SGPC' ], - 'Vaaran Bhai Gurdas Ji': [ 'Amrit Keertan', 'SGPC' ], - 'Zindagi Nama Bhai Nand Lal Ji': [ 'Dr. Ganda Singh' ], - Rehitname: [], - Uggardanti: [], -} - module.exports = { - GURMUKHI_SOURCES, writeJSON, stripExtension, createDir,