summaryrefslogtreecommitdiffstats
path: root/build/creating_data/download-npm-pkgs.sh
diff options
context:
space:
mode:
authorTomáš Levora <t.levora@partner.samsung.com>2019-04-23 14:28:47 +0200
committerTomáš Levora <t.levora@partner.samsung.com>2019-05-09 12:24:21 +0200
commit284fbf8afb0ff784507e7b0f8b9d325e8644f67c (patch)
tree8facf71bf7bb9325b2f428d5d8e1daa5a396c7e2 /build/creating_data/download-npm-pkgs.sh
parent029b36f9f0faedc18b032ebb8c598118ff80f67b (diff)
Fix download scripts to handle empty lines
Fixing download and saving scripts to be able to ignore empty or 00D ending lines in lists Issue-ID: OOM-1818 Change-Id: I55ef1dfbea628f8c1d4b19745536e629a2dbe0c9 Signed-off-by: Tomáš Levora <t.levora@partner.samsung.com>
Diffstat (limited to 'build/creating_data/download-npm-pkgs.sh')
-rwxr-xr-xbuild/creating_data/download-npm-pkgs.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/build/creating_data/download-npm-pkgs.sh b/build/creating_data/download-npm-pkgs.sh
index 9e8847c9..191dd5df 100755
--- a/build/creating_data/download-npm-pkgs.sh
+++ b/build/creating_data/download-npm-pkgs.sh
@@ -16,7 +16,10 @@
#
# COPYRIGHT NOTICE ENDS HERE
-LIST_FILE="$1"
+# Load common-functions library
+. $(dirname ${0})/../common-functions.sh
+
+LIST_FILE="${1}"
if [[ -z "$LIST_FILE" ]]; then
LIST_FILE="all_npm_list.txt"
@@ -30,12 +33,10 @@ fi
mkdir -p "$outdir"
cd "$outdir"
-lines=$(cat "$LIST_FILE" | wc -l)
+lines=$(clean_list "$LIST_FILE" | wc -l)
cnt=1
-while read -r line; do
+for line in $(clean_list "$LIST_FILE"); do
echo "== pkg #$cnt of $lines =="
- # yallist@2.1.2
npm pack $line
cnt=$((cnt+1))
-
-done < "$LIST_FILE"
+done \ No newline at end of file