Skip to content

Commit b5d2411

Browse files
author
Minggang Wang
committed
Add script for generating the package for npm
1 parent 427e79d commit b5d2411

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

Diff for: npm-pack.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (c) 2018 Intel Corporation. All rights reserved.
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
#Usage: npm-pack.sh
18+
19+
WORKDIR=`mktemp -d`
20+
RAWMODULEDIR="ros2-web-bridge/"
21+
MODULEDIR="$WORKDIR/$RAWMODULEDIR"
22+
23+
mkdir -p $MODULEDIR
24+
rsync -a . $MODULEDIR --exclude dist --exclude node_modules --exclude Dockerfile --exclude appveyor.yml --exclude .travis.yml
25+
26+
pushd . > /dev/null
27+
cd $WORKDIR
28+
FILENAME=`npm pack $RAWMODULEDIR`
29+
TARFILENAME="$WORKDIR/$FILENAME"
30+
31+
popd > /dev/null
32+
mkdir -p dist
33+
cp -f $TARFILENAME ./dist/
34+
rm -rf $WORKDIR
35+
36+
echo "Generated ./dist/$FILENAME"

0 commit comments

Comments
 (0)