All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [v2 4/6] package/nodejs: Add /usr/lib/node_modules/.bin to PATH
Date: Mon, 29 Jun 2015 19:20:33 +0200	[thread overview]
Message-ID: <20150629172033.GC3669@free.fr> (raw)
In-Reply-To: <CAFGQKxcrYMsVW+D2Kzwb0A7F529TctGU0KEWGtGXAsx-ATxSqg@mail.gmail.com>

Martin, All,

On 2015-06-29 10:13 +0100, Martin Bark spake thusly:
> Yes I agree your way is easier to read, I'll update my patch and resubmit it.

Great, thanls! :-)

> The reason this is useful is because there lots of node.js packages
> that are normal command line apps designed to be installed globally.
> For example, if you install http-server
> (https://github.com/indexzero/http-server) then you simple need to cd
> into any directory, type ./http-server and it will server that

You mean, http-server must be in the directory you want to serve? Or did
you mean that you just run /path/to/http-server and it will serve the
current directory?  (I guess the latter.)

> directory up for you.  Another example might be vtop
> (https://github.com/MrRio/vtop), a graphical version of top.
> 
> If you install these apps globally then all the executables will be in
> the /usr/lib/node_modules/.bin directory.  So this patch simply saves
> you typing the full path, the same as for your desktop.

OK, so why not make symlinks (or hadlinks) for each of them in /usr/bin
instead? Something like (untested):

    cd $(TARGET_DIR)/usr/bin; \
    for f in ../../usr/lib/node_modules/.bin/*; do \
        [ -f "$${f}" -a -x "$${f}" ] || continue; \
        ln -sf "$${f}" "$${f##*/}" || exit 1; \
    done

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2015-06-29 17:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-27  2:01 [Buildroot] [v2 1/6] package/nodejs: Bump version to 0.10.39 Martin Bark
2015-06-27  2:01 ` [Buildroot] [v2 2/6] package/nodejs: Update to allow selecting node.js version Martin Bark
2015-06-27 22:11   ` Yann E. MORIN
2015-06-28 13:14   ` Thomas Petazzoni
2015-06-27  2:01 ` [Buildroot] [v2 3/6] package/nodejs: Add node.js v0.12.5 and set as the default version Martin Bark
2015-06-27 22:34   ` Yann E. MORIN
2015-06-29  8:44     ` Martin Bark
2015-06-27  2:01 ` [Buildroot] [v2 4/6] package/nodejs: Add /usr/lib/node_modules/.bin to PATH Martin Bark
2015-06-27 22:44   ` Yann E. MORIN
2015-06-29  9:13     ` Martin Bark
2015-06-29 17:20       ` Yann E. MORIN [this message]
2015-06-29 19:31         ` Martin Bark
2015-06-27  2:01 ` [Buildroot] [v2 5/6] package/nodejs: Define NPM command for other packages to use Martin Bark
2015-06-27 22:53   ` Yann E. MORIN
2015-06-29 10:51     ` Martin Bark
2015-06-29 17:09       ` Yann E. MORIN
2015-06-29 19:34         ` Martin Bark
2015-06-27  2:01 ` [Buildroot] [v2 6/6] package/nodejs: Add npm_config_target_arch to npm command Martin Bark
2015-06-27 22:07 ` [Buildroot] [v2 1/6] package/nodejs: Bump version to 0.10.39 Yann E. MORIN
2015-06-28 12:07 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150629172033.GC3669@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.