mirror of
https://github.com/gwenhael-le-moine/npm2tgz.git
synced 2024-12-27 09:58:57 +01:00
Merge pull request #1 from TJ09/master
Fix trailing comma in parsed version numbers. (feat. TJ09)
This commit is contained in:
commit
cd955d9277
1 changed files with 13 additions and 13 deletions
26
npm2tgz
26
npm2tgz
|
@ -43,19 +43,19 @@ NPMROOT=${NPMROOT:-$($NPMBIN -g root)}
|
||||||
|
|
||||||
[ ! -x $NPMBIN ] && echo "npm missing" && exit 1
|
[ ! -x $NPMBIN ] && echo "npm missing" && exit 1
|
||||||
if [ "x$1" == "x" ] || [ "x$1" == "x--help" ] || [ "x$1" == "x-h" ]; then
|
if [ "x$1" == "x" ] || [ "x$1" == "x--help" ] || [ "x$1" == "x-h" ]; then
|
||||||
echo "$0 generates a Slackware compatible package from a node module"
|
echo "$0 generates a Slackware compatible package from a node module"
|
||||||
echo " usage: <OPTIONS> $0 <modules_name>"
|
echo " usage: <OPTIONS> $0 <modules_name>"
|
||||||
echo " The resulting package is located under $OUTPUT"
|
echo " The resulting package is located under $OUTPUT"
|
||||||
echo " possible OPTIONS are:"
|
echo " possible OPTIONS are:"
|
||||||
echo " BUILD=<value> (currently: $BUILD)"
|
echo " BUILD=<value> (currently: $BUILD)"
|
||||||
echo " TAG=<value> (currently: $TAG)"
|
echo " TAG=<value> (currently: $TAG)"
|
||||||
echo " OUTPUT=<value> (currently: $OUTPUT)"
|
echo " OUTPUT=<value> (currently: $OUTPUT)"
|
||||||
echo " ARCH=<value> (currently: $ARCH)"
|
echo " ARCH=<value> (currently: $ARCH)"
|
||||||
echo " PREFIX=<value> (currently: $PREFIX)"
|
echo " PREFIX=<value> (currently: $PREFIX)"
|
||||||
echo " NPMBIN=<value> (currently: $NPMBIN)"
|
echo " NPMBIN=<value> (currently: $NPMBIN)"
|
||||||
echo " NPMROOT=<value> (currently: $NPMROOT)"
|
echo " NPMROOT=<value> (currently: $NPMROOT)"
|
||||||
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PRGNAM=$1
|
PRGNAM=$1
|
||||||
|
@ -66,7 +66,7 @@ mkdir -p $PKG
|
||||||
|
|
||||||
DESTDIR=$PKG npm install -g $PRGNAM
|
DESTDIR=$PKG npm install -g $PRGNAM
|
||||||
|
|
||||||
VERSION=$(grep -i "\"version\": \"\(.*\)\"" $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"version": "\(.*\)"|\1|g')
|
VERSION=$(grep -io "\"version\": \"\(.*\)\"" $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"version": "\(.*\)"|\1|g')
|
||||||
DESCRIPTION=$(grep -i "\"description\": \"\(.*\)\"," $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"description": "\(.*\)",$|\1|g')
|
DESCRIPTION=$(grep -i "\"description\": \"\(.*\)\"," $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"description": "\(.*\)",$|\1|g')
|
||||||
HOMEPAGE=$(grep -i "\"homepage\": \"\(.*\)\"," $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"homepage": "\(.*\)",$|\1|g')
|
HOMEPAGE=$(grep -i "\"homepage\": \"\(.*\)\"," $PKG${NPMROOT}/$PRGNAM/package.json | sed 's|^[ ]*"homepage": "\(.*\)",$|\1|g')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue