duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

file such as `example.js.js` won't load #420

Open termhare opened 9 years ago

termhare commented 9 years ago

If you have a file named:

example.js.js

And you try to require it with this:

var exampleJS = require('./example.js');

It will error on download:

    installed : ianstormtaylor-is@0.1.1
        error : Error: Command failed: /bin/sh -c git ls-remote --tags --heads https://<token>@github.com/libraries/analytics.js
remote: Repository not found.
fatal: repository 'https://<token>@github.com/libraries/analytics.js/' not found

    at error (/Users/lancejpollard/hacks/h96/node_modules/duo/node_modules/duo-package/node_modules/gh-resolve/index.js:177:10)
    at /Users/lancejpollard/hacks/h96/node_modules/duo/node_modules/duo-package/node_modules/gh-resolve/index.js:69:37
    at ChildProcess.exithandler (child_process.js:736:5)
    at ChildProcess.EventEmitter.emit (events.js:110:17)
    at maybeClose (child_process.js:992:16)
    at Process.ChildProcess._handle.onexit (child_process.js:1059:5)

We have had functionality like this for a long time, such as when requiring syntax highlighters for different languages. For example, we happened to have files called:

analytics-ruby.js
analytics.js.js
analytics.NET.js
...

So a workaround is to just rename to:

analytics-NET.js
analytics-javascript.js
...

but wanted to point out anyways.

dominicbarnes commented 9 years ago

I'm looking into this right now, but I have noticed that if you use the (albeit uglify) ./example.js.js, then it does work as expected.