File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -59,20 +59,20 @@ export function fetchData(url) {
59
59
return fetch ( url )
60
60
}
61
61
62
- export async function findUserJS ( dir = this . findUserJS . monorepoRoot ) {
62
+ export async function findUserJS ( dir = global . monorepoRoot ) {
63
63
const userJSfiles = [ ]
64
- if ( ! dir && ! this . findUserJS . monorepoRoot ) { // no arg passed, init monorepo root
64
+ if ( ! dir && ! global . monorepoRoot ) { // no arg passed, init monorepo root
65
65
dir = path . dirname ( fileURLToPath ( import . meta. url ) )
66
66
while ( ! fs . existsSync ( path . join ( dir , 'package.json' ) ) )
67
67
dir = path . dirname ( dir ) // traverse up to closest manifest dir
68
- this . findUserJS . monorepoRoot = dir
68
+ global . monorepoRoot = dir
69
69
}
70
70
dir = path . resolve ( dir )
71
71
fs . readdirSync ( dir ) . forEach ( async entry => {
72
72
if ( / ^ (?: \. | n o d e _ m o d u l e s $ ) / . test ( entry ) ) return
73
73
const entryPath = path . join ( dir , entry )
74
74
if ( fs . statSync ( entryPath ) . isDirectory ( ) ) // recursively search subdirs
75
- userJSfiles . push ( ...await this . findUserJS ( entryPath ) )
75
+ userJSfiles . push ( ...await findUserJS ( entryPath ) )
76
76
else if ( entry . endsWith ( '.user.js' ) ) {
77
77
console . log ( entryPath ) ; userJSfiles . push ( entryPath ) }
78
78
} )
You can’t perform that action at this time.
0 commit comments