- NodeJS 8.2.0 adds support for npx binary. Add conditional

support to our wrapper
- Print a helpful message if wrapper cannot find target executable
- Wrapper only executes from /usr/bin and not PATH

OBS-URL: https://build.opensuse.org/package/show/devel:languages:nodejs/nodejs-common?expand=0&rev=6
This commit is contained in:
Adam Majer 2017-08-02 14:59:33 +00:00 committed by Git OBS Bridge
parent 3ffeed54b9
commit e5b325e7ce
3 changed files with 21 additions and 7 deletions

6
node
View File

@ -3,5 +3,9 @@
PROG=$(basename $0)
PROG_VERSION=${NODE_VERSION:--default}
exec ${PROG}${PROG_VERSION} "$@"
if [ ! -x /usr/bin/${PROG}${PROG_VERSION} ]; then
echo "${PROG}${PROG_VERSION} is unavailable."
exit 127
fi
exec /usr/bin/${PROG}${PROG_VERSION} "$@"

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Wed Aug 2 14:29:04 UTC 2017 - adam.majer@suse.de
- NodeJS 8.2.0 adds support for `npx` binary. Add conditional
support to our wrapper
- Print a helpful message if wrapper cannot find target executable
- Wrapper only executes from /usr/bin and not PATH
-------------------------------------------------------------------
Tue Jul 18 10:20:06 UTC 2017 - adam.majer@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package nodejs-common
#
# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
###########################################################
#
# WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
@ -25,12 +26,12 @@
###########################################################
Name: nodejs-common
Version: 1.0
Version: 2.0
Release: 0
License: MIT
Summary: Common files for the NodeJS ecosystem
Url: https://github.com/AdamMajer/nodejs-packaging
License: MIT
Group: Development/Languages/NodeJS
Url: https://github.com/AdamMajer/nodejs-packaging
Source1: node
Requires: nodejs
Conflicts: nodejs4 < 4.8.4
@ -50,11 +51,12 @@ while retaining the same codestream version.
%install
install -D -m 0755 %{S:1} %{buildroot}%{_bindir}/node
ln -s node %{buildroot}%{_bindir}/npm
ln -s node %{buildroot}%{_bindir}/npx
%files
%defattr(-,root,root)
%{_bindir}/node
%{_bindir}/npm
%{_bindir}/npx
%changelog