duojs / duo

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

Unexpected duo(1) commands #230

Open matthewmueller opened 10 years ago

matthewmueller commented 10 years ago

By including node_modules/, duo will now take commands like:

$ duo watch
$ duo jade
$ duo string-to-js
$ duo package
$ duo pack
$ duo main

I think we might need to do something about this, what do you guys think?

/cc @dominicbarnes @stephenmathieson:

stephenmathieson commented 10 years ago

Haha yikes! Can we check duo-* flags? Force users to chmod +x their subcommand?

matthewmueller commented 10 years ago

+1, i think that's a great idea. aren't we doing a stat() call anyway to check for existence?

matthewmueller commented 10 years ago

oh, wait i think i misunderstood. aren't most plugins just source and not executables?

ianstormtaylor commented 10 years ago

Can we test for duo-* prefix regardless for the dep? Forcing people to prefix their plugins with duo- wouldn't be the worst yeah? Maybe I'm misunderstanding

matthewmueller commented 10 years ago

yah, we do that already, those repos are duo-watch, duo-jade, etc.

stephenmathieson commented 10 years ago

aren't most plugins just source and not executables

nope:

stephenmathieson at MBP in ~/repos/duo on master
$ ls -lsa bin/
total 56
 0 drwxr-xr-x   6 stephenmathieson  staff   204 Aug 22 09:00 .
 0 drwxr-xr-x  18 stephenmathieson  staff   612 Aug 22 09:00 ..
24 -rwxr-xr-x   1 stephenmathieson  staff  8425 Aug 21 14:03 _duo
 8 -rwxr-xr-x   1 stephenmathieson  staff   434 Aug 22 09:00 duo
16 -rwxr-xr-x   1 stephenmathieson  staff  4200 Aug 21 14:03 duo-duplicates
 8 -rwxr-xr-x   1 stephenmathieson  staff  3059 Aug 21 14:03 duo-ls

and:

stephenmathieson at MBP in ~/repos/duo-test on master
$ ls -lsa bin/
total 40
0 drwxr-xr-x   7 stephenmathieson  staff   238 Aug  5 15:34 .
0 drwxr-xr-x  14 stephenmathieson  staff   476 Aug  5 15:34 ..
8 -rw-r--r--   1 stephenmathieson  staff    72 Aug  5 15:34 browsers.json
8 -rwxr-xr-x   1 stephenmathieson  staff  1290 Aug  5 15:34 duo-test
8 -rwxr-xr-x   1 stephenmathieson  staff  2236 Aug  5 15:34 duo-test-browser
8 -rwxr-xr-x   1 stephenmathieson  staff  1620 Aug  5 15:34 duo-test-phantomjs
8 -rwxr-xr-x   1 stephenmathieson  staff  3693 Aug  5 15:34 duo-test-saucelabs
stephenmathieson commented 10 years ago

hmm just thought of something: if we stat(plugin) and check for +x, windows users will suffer. iirc, windows doesn't have any concept of flags...

matthewmueller commented 10 years ago

oh duh, i was thinking about the plugins, can't we just pull from bin/ and node_modules/.bin/?

stephenmathieson commented 10 years ago

node_modules/.bin

yep! good idea!