chrissimpkins / glue

Glue is a plugin that joins your shell to Sublime Text in quasi-perfect harmony.
http://gluedocs.readthedocs.org/
MIT License
254 stars 10 forks source link

Apparently not working with npm packages #4

Closed fregante closed 10 years ago

fregante commented 10 years ago

I set the path as described in the help (and restarted ST3)

{
    "glue_userpath": "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/bfred/bin:/Users/bfred/.node/bin:/usr/local/bin:/usr/local/mysql/bin"
}

Tools like brew and ffmpeg seem to run correctly, but anything installed via npm is not found, even if I type the direct path to the binary file:

 █ [ /Users/bfred ] /Users/bfred/.node/lib/node_modules/grunt-cli/bin/grunt
 env: node: No such file or directory

Am I doing something wrong? I'm on OS X 10.9.2 and npm packages run correctly in Terminal.app

chrissimpkins commented 10 years ago

@bfred-it : You need to execute the file on that path with the node executable:

✪ [ /Users/ces ] node /usr/local/lib/node_modules/grunt-cli/bin/grunt --version
grunt-cli v0.1.13
grunt v0.4.4

It must be a link to a JavaScript source file so it needs node lovin from the Glue command line...

Enjoy!

chrissimpkins commented 10 years ago

@bfred-it : thanks much for pointing this out. I will include this information in the documentation.

chrissimpkins commented 10 years ago

@bfred-it : and as an aside, you could make a grunt command in Glue with this in your glue.json file:

{
     "grunt": "node /Users/bfred/.node/lib/node_modules/grunt-cli/bin/grunt"
}

and then use it in Glue like this:

█ [ /Users/bfred ] glue grunt

I don't use Grunt but based upon what I've read it does not require you to include an argument on the command line specifying the gruntfile that is executed. If you do happen to need to pass a file path argument, use this in glue.json:

{
     "grunt": "node /Users/bfred/.node/lib/node_modules/grunt-cli/bin/grunt {{args}}"
}

and then use it in Glue like this:

█ [ /Users/bfred ] glue grunt myfile.js

More documentation on the Glue extensions is available here.

fregante commented 10 years ago

I wasn't happy with that solution and found the package Fix Mac Path. Now grunt runs without any hacks :)

chrissimpkins commented 10 years ago

Excellent! I will check it out. Thanks for linking it

chrissimpkins commented 10 years ago

Do you use bash? I am playing with the /usr/bin/login approach that they use and it doesn't work with zsh + oh my zsh. I am going to try to implement this through bash as the default. I suspect that will address this concern for many/most users.

fregante commented 10 years ago

I do use bash

chrissimpkins commented 10 years ago

Thanks. Will have this in a release later today. Thanks again for pointing it out.

On Apr 2, 2014, at 9:17 AM, Federico Brigante notifications@github.com wrote:

I do use bash

— Reply to this email directly or view it on GitHub.

chrissimpkins commented 10 years ago

I pushed the new release to Package Control and it should be available for upgrade in the next hour. It should work without the additional package that you installed. Let me know if you still have problems.

fregante commented 10 years ago

That did it! I disabled FixMacPath, updated Glue and had to restart ST3.

One thing though, it looks like there are some "ESC" characters when the output is supposed to be colored, I'm not sure whether it's Grunt's fault:

Glue with ESC characters

It looks like this in the terminal:

Terminal with colors

Also, thanks for the public thanks :)

chrissimpkins commented 10 years ago

Excellent. Glad to hear that it worked. My pleasure. I really appreciate that you took the time to report it. I need to look into the special character issue more. I don't know why it is printing those characters. I will create a new issue for it.

Enjoy!

On Apr 3, 2014, at 9:25 AM, Federico Brigante notifications@github.com wrote:

That did it!

One thing though, it looks like there are some "ESC" characters when the output is supposed to be colored, I'm not sure whether it's Grunt's fault:

It looks like this in the terminal:

Also, thanks for the public thanks :)

— Reply to this email directly or view it on GitHub.