Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readdirSync is returning files from wrong path #31

Open
georgejecook opened this issue Apr 25, 2019 · 4 comments
Open

readdirSync is returning files from wrong path #31

georgejecook opened this issue Apr 25, 2019 · 4 comments

Comments

@georgejecook
Copy link

given

``` debug(processing files at path ${process.cwd()} );

let fileProcessor = new FileProcessor(this._config);
fileProcessor.rootPath = process.cwd();
let files = glob.readdirSync(this._config.globPattern);
files.forEach( (file) => {```

where the process.cwd() is /Users/georgecook/Documents/h7ci/hope/opensource/navSpike/build/.roku-deploy-staging

and a globPattern of **/*.brs

I find the returned files have a path of .roku-deploy-staging/components/Framework/Core/BaseAggregateView.brs - this is wrong! that folder doesn't even exist - it's as if readdirSync is running the glob against build instead of build.roku-deploy-staging

I'll have to stop using this package if I can't get around this, as it's breaking my tools.

@georgejecook
Copy link
Author

note - I used cwd flag as per #16 - still does the wrong behaviour, acting as if it's one level up

@georgejecook
Copy link
Author

it seems the problem is specifically folders which start with a . - it simply ignores them, which renders this unusable.

@AraHaan
Copy link

AraHaan commented May 19, 2021

That is by default you can disable that however.

@AraHaan
Copy link

AraHaan commented Jun 15, 2021

I use this in my github action and for some reason it's not finding files with this glob pattern **/*.csproj.

const globfs = require("glob-fs")()

class Action {

    constructor() {
    }

    // snip some other unrelated stuff.

    run() {
        // unrelated: checks if input is not a glob then call _run_internal
        // otherwise call _run_internal after resetting "projectFile", and
        // "versionFile" to the relative path of the file found by the glob pattern.
        globfs.readdirSync('**/*.csproj').forEach(function (file) {
            this.projectFile = file.relative
            this.versionFile = file.relative
            this._run_internal()
        })
    }
}

new Action().run()

However for some reason it skips everything in the forEach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants