diff --git a/node b/node index 1161cd6..aa4ce44 100644 --- a/node +++ b/node @@ -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} "$@" diff --git a/nodejs-common.changes b/nodejs-common.changes index a42e678..7f56a39 100644 --- a/nodejs-common.changes +++ b/nodejs-common.changes @@ -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 @@ -6,4 +14,4 @@ Tue Jul 18 10:20:06 UTC 2017 - adam.majer@suse.de ------------------------------------------------------------------- Fri Jul 7 13:09:29 UTC 2017 - adam.majer@suse.de -- Initial release. +- Initial release. diff --git a/nodejs-common.spec b/nodejs-common.spec index 1c891ec..7755bb9 100644 --- a/nodejs-common.spec +++ b/nodejs-common.spec @@ -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 -