4 # Copyright 2016 RIFT.IO Inc
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
19 # Unpack tar archives for plugins. Maintain a timestamp.txt file for each, so
20 # that tar archives are only unpacked if they have been changed.
22 # This script is needed to unpack the files as cpack cannot handle a lot of files.
25 echo "usage: $(basename ${BASH_SOURCE[0]})"
28 function extract_node_modules() {
29 tar xf node_modules.tar
33 # change to the directory of this script
34 THIS_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
37 echo "Handling plugin node modules"
41 echo "Checking plugin "${dir}" for newer node_modules"
43 if [ ! -f timestamp.txt ]; then
44 echo "timestamp file not found ... node_modules need to be expanded and timestamp needs to be touched"
47 echo "Checking if node_modules.tar has a newer timestamp than timestamp.txt"
48 if [[ node_modules.tar -nt timestamp.txt ]]; then
49 echo "node_modules.tar is newer than timestamp ... node modules need to be expanded and timestamp needs to be touched"
52 echo "node_modules.tar is older than timestamp ... nothing needs to be done"
56 echo "Checking plugin "${dir}" for newer node_modules ...done"