From 6ff5a4326df26c76d0e9cf9d93a34ee10fa41b67 Mon Sep 17 00:00:00 2001 From: Will Abson Date: Thu, 28 Jul 2016 10:25:32 +0100 Subject: [PATCH] Remove static list of components from clean and publish scripts --- scripts/npm-clean.sh | 22 ++++++---------------- scripts/npm-publish.sh | 26 +++++++------------------- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/scripts/npm-clean.sh b/scripts/npm-clean.sh index c1d492be4c..9937d009aa 100755 --- a/scripts/npm-clean.sh +++ b/scripts/npm-clean.sh @@ -1,23 +1,13 @@ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +components_dir="$DIR/../ng2-components" -for PACKAGE in \ - ng2-activiti-form \ - ng2-activiti-processlist \ - ng2-activiti-tasklist \ - ng2-alfresco-core \ - ng2-alfresco-datatable \ - ng2-alfresco-documentlist \ - ng2-alfresco-login \ - ng2-alfresco-search \ - ng2-alfresco-upload \ - ng2-alfresco-viewer \ - ng2-alfresco-webscript -do - echo "====== clean component: ${PACKAGE} =====" - cd "$DIR/../ng2-components/${PACKAGE}" - npm run clean +for comp_dir in $( ls "$components_dir" ); do + test -f "$components_dir/$comp_dir/package.json" && \ + cd "$components_dir/$comp_dir" \ + && echo "====== clean component: ${PACKAGE} =====" && \ + npm run clean done cd "$DIR/../demo-shell-ng2" diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index 98f4954326..549c36a98b 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -1,26 +1,14 @@ #!/usr/bin/env bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +components_dir="$DIR/../ng2-components" "$DIR/npm-clean.sh" -for PACKAGE in \ - ng2-activiti-form \ - ng2-activiti-processlist \ - ng2-activiti-tasklist \ - ng2-alfresco-core \ - ng2-alfresco-datatable \ - ng2-alfresco-documentlist \ - ng2-alfresco-login \ - ng2-alfresco-search \ - ng2-alfresco-upload \ - ng2-alfresco-viewer \ - ng2-alfresco-webscript -do - DESTDIR="$DIR/../ng2-components/${PACKAGE}" - echo "====== PUBLISHING: ${DESTDIR} =====" - cd ${DESTDIR} - npm install - npm publish - cd ${DIR} +for comp_dir in $( ls "$components_dir" ); do + test -f "$components_dir/$comp_dir/package.json" && \ + cd "$components_dir/$comp_dir" && \ + echo "====== PUBLISHING: ${DESTDIR} =====" && \ + npm install && \ + npm publish done