Code Monkey home page Code Monkey logo

Comments (14)

satazor avatar satazor commented on July 19, 2024

Please note that there's also some debug messages being printed:

JOIN 5 / /Users/xxx/Work/test
JOIN 6 / /Users/xxx/Work/test
JOIN 0 / /Users/xxx/Work/test
JOIN 1 / /Users/xxx/Work/test

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Debug messages are fixed by #55

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Hm, I can't seem to reproduce.

c:\globtest\node-glob>node g.js
c:\globtest\node-glob\ [ 'c:/globtest/node-glob/' ]
c:\globtest\node-glob [ 'c:/globtest/node-glob/' ]

c:\globtest\node-glob>cd test

c:\globtest\node-glob\test>node ../g.js
c:\globtest\node-glob\ [ 'c:/globtest/node-glob/' ]
c:\globtest\node-glob [ 'c:/globtest/node-glob/' ]

c:\globtest\node-glob\test>cp ../g.js ./g.js

c:\globtest\node-glob\test>node g.js
c:\globtest\node-glob\test\ [ 'c:/globtest/node-glob/test/' ]
c:\globtest\node-glob\test [ 'c:/globtest/node-glob/test/' ]

c:\globtest\node-glob\test>cd ..

c:\globtest\node-glob>cd ..

c:\globtest>cd ..

c:\>node c:\globtest\node-glob\test\g.js
c:\globtest\node-glob\test\ [ 'c:/globtest/node-glob/test/' ]
c:\globtest\node-glob\test [ 'c:/globtest/node-glob/test/' ]

c:\>z:

Z:\>node c:\globtest\node-glob\test\g.js
c:\globtest\node-glob\test\ [ 'c:/globtest/node-glob/test/' ]
c:\globtest\node-glob\test [ 'c:/globtest/node-glob/test/' ]

Is it possible that you were using a different version of glob or something?

from node-glob.

satazor avatar satazor commented on July 19, 2024

Hmm not really but I will try it again later with my windows machine (I switched to MacOSX few weeks ago).

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Any chance to try to repro this?

from node-glob.

satazor avatar satazor commented on July 19, 2024

Still reproducible.

Running:

var glob = require('glob');

glob(__dirname + '\\', { mark: true }, function (err, matches) {
    console.log(matches); // Contains the __dirname without the \ or / added to the end
});

Outputs:

C:\Work\test>node -v
v0.10.4

C:\Work\test>node test
[ 'C:/Work/test' ]

C:\Work\test>

Fresh installed windows 7 x64 (virtual machine).

from node-glob.

satazor avatar satazor commented on July 19, 2024

@isaacs can you reopen the issue?

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Actually, this seems to work for me.

// t.js
var glob = require('glob');
var assert = require('assert');

glob(__dirname + '\\', { mark: true }, function (err, matches) {
    // Should contain the dirname with / on the end
    console.log(matches);
    console.log("glob version %s", require('glob/package.json').version);
    console.log("node version %s", process.version);
    assert.equal(matches[0], __dirname.replace(/\\+/g, '/') + '/');
    console.log('ok');
});
C:\globtest\x>C:\node-v0.10.12\Release\node.exe t.js
[ 'C:/globtest/x/' ]
glob version 3.1.14
node version v0.10.12
ok

Are you sure you're using the latest version of glob?

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Note, a "fresh install of windows" doesn't matter if you're using an old install of node and glob. Do npm ls glob to see which version you're using, and npm install glob@latest to make sure to install the latest one.

from node-glob.

satazor avatar satazor commented on July 19, 2024

I still have the same issue..

C:\test>node -v
v0.10.12

C:\test>node test.js
[ 'C:/test' ]

Using [email protected].
Are you emulating windows by any chance?

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Ha! I was the one using an outdated glob! Apparently this was fixed in 3.1.14, but regressed in 3.2.

C:\globtest\x>C:\node-v0.10.12\Release\node.exe t.js
[ 'C:/globtest/x' ]
glob version 3.2.1
node version v0.10.12

assert.js:92
  throw new assert.AssertionError({
        ^
AssertionError: "C:/globtest/x" == "C:/globtest/x/"
    at C:\globtest\x\t.js:9:12
    at Glob.<anonymous> (C:\globtest\node_modules\glob\glob.js:90:7)
    at Glob.EventEmitter.emit (events.js:95:17)
    at Glob._processEmitQueue (C:\globtest\node_modules\glob\glob.js:294:10)
    at Glob.emitMatch (C:\globtest\node_modules\glob\glob.js:271:10)
    at Glob._finish (C:\globtest\node_modules\glob\glob.js:232:8)
    at Glob.<anonymous> (C:\globtest\node_modules\glob\glob.js:173:27)
    at Glob.cb (C:\globtest\node_modules\glob\glob.js:315:11)
    at Glob.<anonymous> (C:\globtest\node_modules\glob\glob.js:355:16)
    at Glob._afterStat (C:\globtest\node_modules\glob\glob.js:561:6)

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Yes, I'm emulating windows 7 in VMWare. I don't have a "real" bare-metal windows machine.

from node-glob.

satazor avatar satazor commented on July 19, 2024

That's fine, I'm using that too.

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Fixed on latest release. Issue was that path.resolve() removes trailing slashes.

from node-glob.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.