File tree Expand file tree Collapse file tree 4 files changed +20
-27
lines changed Expand file tree Collapse file tree 4 files changed +20
-27
lines changed Original file line number Diff line number Diff line change 11
11
with :
12
12
node-version : ' latest'
13
13
- run : yarn install
14
- - run : yarn run syncDriver
14
+ - run : yarn run syncDriver:github
15
15
env :
16
16
MONGODB_URI : ${{ secrets.MONGODB_URI }}
17
+ DOWNLOAD_URL : ${{ secrets.DOWNLOAD_URL }}
18
+ VIEW_URL : ${{secrets.VIEW_URL}}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ const mongoose = require('mongoose');
3
3
const fs = require ( 'fs' ) . promises ;
4
4
5
5
const connectMongoDB = async ( ) => {
6
- require ( 'dotenv' ) . config ( ) ; // for running locally
7
6
await mongoose . connect ( process . env . MONGODB_URI ) . catch ( async ( err ) => {
8
7
console . log ( 'Error while mongoose connection: ' , err ) ;
9
8
await disconnectMongoDB ( 1 ) ;
@@ -41,10 +40,8 @@ init();
41
40
42
41
// traversing fileNames and extract data
43
42
const extractDataFromMarkdown = async ( fileNames ) => {
44
- const DOWNLOAD_URL =
45
- 'https://github.com/GauravWalia19/Free-Algorithms-Books/raw/master/Library/' ;
46
- const VIEW_URL =
47
- 'https://github.com/GauravWalia19/Free-Algorithms-Books/blob/master/Library/' ;
43
+ const DOWNLOAD_URL = process . env . DOWNLOAD_URL ;
44
+ const VIEW_URL = process . env . VIEW_URL ;
48
45
let objectDatabase = [ ] ;
49
46
50
47
for ( let i = 0 ; i < fileNames . length ; i ++ ) {
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " free-algorithm-books" ,
3
- "version" : " 1.0.0" ,
4
- "description" : " Free Algorithm Books driver project" ,
5
- "main" : " driver.js" ,
6
- "scripts" : {
7
- "syncDriver" : " node driver.js"
8
- },
9
- "repository" : " https://github.com/GauravWalia19/Free-Algorithms-Books.git" ,
10
- "author" :
" Gaurav Walia <[email protected] >" ,
11
- "license" : " MIT" ,
12
- "devDependencies" : {
13
- "dotenv" : " ^16.4.4"
14
- },
15
- "dependencies" : {
16
- "mongoose" : " ^8.1.3"
17
- }
2
+ "name" : " free-algorithm-books" ,
3
+ "version" : " 1.1.0" ,
4
+ "description" : " Free Algorithm Books driver project" ,
5
+ "main" : " driver.js" ,
6
+ "scripts" : {
7
+ "syncDriver:local" : " node --env-file=.env driver.js" ,
8
+ "syncDriver:github" : " node driver.js"
9
+ },
10
+ "repository" : " https://github.com/GauravWalia19/Free-Algorithms-Books.git" ,
11
+ "author" :
" Gaurav Walia <[email protected] >" ,
12
+ "license" : " MIT" ,
13
+ "devDependencies" : {},
14
+ "dependencies" : {
15
+ "mongoose" : " ^8.1.3"
16
+ }
18
17
}
Original file line number Diff line number Diff line change 33
33
dependencies :
34
34
ms "2.1.2"
35
35
36
- dotenv@^16.4.4 :
37
- version "16.4.4"
38
- resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.4.tgz#a26e7bb95ebd36272ebb56edb80b826aecf224c1"
39
- integrity sha512-XvPXc8XAQThSjAbY6cQ/9PcBXmFoWuw1sQ3b8HqUCR6ziGXjkTi//kB9SWa2UwqlgdAIuRqAa/9hVljzPehbYg==
40
-
41
36
42
37
version "2.5.1"
43
38
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.5.1.tgz#7b8203e11819a8e77a34b3517d3ead206764d15d"
You can’t perform that action at this time.
0 commit comments