File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed
Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change 1010 ssri = require ( 'ssri' ) // to generate SHA-256 hashes
1111
1212 // Init REPO context
13- const repoName = 'amazongpt' ,
14- userJSfilePath = `./greasemonkey/${ repoName } .user.js`
13+ const repoName = ( ( ) => {
14+ const path = require ( 'path' ) ; let dir = __dirname
15+ while ( ! fs . existsSync ( path . join ( dir , 'package.json' ) ) ) dir = path . dirname ( dir )
16+ return path . basename ( dir )
17+ } ) ( )
18+ const userJSfilePath = `./greasemonkey/${ repoName } .user.js`
1519
1620 // Init UI COLORS
1721 const nc = '\x1b[0m' , // no color
Original file line number Diff line number Diff line change 1010 ssri = require ( 'ssri' ) // to generate SHA-256 hashes
1111
1212 // Init REPO context
13- const repoName = 'bravegpt' ,
14- userJSfilePath = `./greasemonkey/${ repoName } .user.js`
13+ const repoName = ( ( ) => {
14+ const path = require ( 'path' ) ; let dir = __dirname
15+ while ( ! fs . existsSync ( path . join ( dir , 'package.json' ) ) ) dir = path . dirname ( dir )
16+ return path . basename ( dir )
17+ } ) ( )
18+ const userJSfilePath = `./greasemonkey/${ repoName } .user.js`
1519
1620 // Init UI COLORS
1721 const nc = '\x1b[0m' , // no color
Original file line number Diff line number Diff line change 1010 ssri = require ( 'ssri' ) // to generate SHA-256 hashes
1111
1212 // Init REPO context
13- const repoName = 'duckduckgpt' ,
14- userJSfilePath = `./greasemonkey/${ repoName } .user.js`
13+ const repoName = ( ( ) => {
14+ const path = require ( 'path' ) ; let dir = __dirname
15+ while ( ! fs . existsSync ( path . join ( dir , 'package.json' ) ) ) dir = path . dirname ( dir )
16+ return path . basename ( dir )
17+ } ) ( )
18+ const userJSfilePath = `./greasemonkey/${ repoName } .user.js`
1519
1620 // Init UI COLORS
1721 const nc = '\x1b[0m' , // no color
Original file line number Diff line number Diff line change 1010 ssri = require ( 'ssri' ) // to generate SHA-256 hashes
1111
1212 // Init REPO context
13- const repoName = 'googlegpt' ,
14- userJSfilePath = `./greasemonkey/${ repoName } .user.js`
13+ const repoName = ( ( ) => {
14+ const path = require ( 'path' ) ; let dir = __dirname
15+ while ( ! fs . existsSync ( path . join ( dir , 'package.json' ) ) ) dir = path . dirname ( dir )
16+ return path . basename ( dir )
17+ } ) ( )
18+ const userJSfilePath = `./greasemonkey/${ repoName } .user.js`
1519
1620 // Init UI COLORS
1721 const nc = '\x1b[0m' , // no color
You can’t perform that action at this time.
0 commit comments