mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Re-work demo-shell script
This commit is contained in:
@@ -1,103 +1,37 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
components_dir="$DIR/../ng2-components"
|
||||||
|
|
||||||
npm install -g typings
|
npm_opts="--loglevel=silent"
|
||||||
|
|
||||||
#LINK CORE
|
function link_alfresco_ng2_deps() {
|
||||||
echo "====== linking component: ng2-alfresco-core ====="
|
cd $1
|
||||||
cd "$DIR/../ng2-components/ng2-alfresco-core"
|
for dep in $( list-dependencies '^ng2-(alfresco|activiti)-' ); do
|
||||||
npm link
|
npm link --ignore-scripts $npm_opts "$dep"
|
||||||
npm run typings
|
done
|
||||||
npm run build
|
}
|
||||||
|
|
||||||
#LINK FORM
|
npm install $npm_opts -g typings
|
||||||
echo "====== linking component: ng2-activiti-form ====="
|
npm install $npm_opts -g @wabson/list-dependencies
|
||||||
cd "$DIR/../ng2-components/ng2-activiti-form"
|
|
||||||
npm link ng2-alfresco-core
|
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
#LINK DATATABLE
|
# First link each component into /usr/local/lib/node_modules
|
||||||
echo "====== linking component: ng2-alfresco-datatable ====="
|
for comp_dir in $( ls "$components_dir" ); do
|
||||||
cd "$DIR/../ng2-components/ng2-alfresco-datatable"
|
echo "Link $components_dir/$comp_dir"
|
||||||
npm link ng2-alfresco-core
|
test -f "$components_dir/$comp_dir/package.json" && cd "$components_dir/$comp_dir" && npm link --ignore-scripts
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
#LINK DOCUMENTLIST
|
|
||||||
echo "====== linking component: ng2-alfresco-documentlist ====="
|
|
||||||
cd "$DIR/../ng2-components/ng2-alfresco-documentlist"
|
|
||||||
npm link ng2-alfresco-core
|
|
||||||
npm link ng2-alfresco-datatable
|
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
#LINK WEBSCRIPT
|
|
||||||
echo "====== linking component: ng2-alfresco-webscript ====="
|
|
||||||
cd "$DIR/../ng2-components/ng2-alfresco-webscript"
|
|
||||||
npm link ng2-alfresco-core
|
|
||||||
npm link ng2-alfresco-datatable
|
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
#LINK TASKLIST
|
|
||||||
echo "====== linking component: ng2-activiti-tasklist ====="
|
|
||||||
cd "$DIR/../ng2-components/ng2-activiti-tasklist"
|
|
||||||
npm link ng2-alfresco-core
|
|
||||||
npm link ng2-alfresco-datatable
|
|
||||||
npm link ng2-activiti-form
|
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
#LINK PROCESSLIST
|
|
||||||
echo "====== linking component: ng2-activiti-processlist ====="
|
|
||||||
cd "$DIR/../ng2-components/ng2-activiti-processlist"
|
|
||||||
npm link ng2-alfresco-core
|
|
||||||
npm link ng2-alfresco-datatable
|
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
#LINK ALL THE OTHERS COMPONENTS
|
|
||||||
for PACKAGE in \
|
|
||||||
ng2-alfresco-login \
|
|
||||||
ng2-alfresco-search \
|
|
||||||
ng2-alfresco-upload \
|
|
||||||
ng2-alfresco-viewer \
|
|
||||||
ng2-alfresco-webscript
|
|
||||||
do
|
|
||||||
DESTDIR="$DIR/../ng2-components/${PACKAGE}"
|
|
||||||
echo "====== linking component: ${PACKAGE} ====="
|
|
||||||
cd "$DESTDIR"
|
|
||||||
npm link ng2-alfresco-core
|
|
||||||
npm link
|
|
||||||
npm run typings
|
|
||||||
npm run build
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Now link inter-dependencies between components
|
||||||
#LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
|
for comp_dir in $( ls "$components_dir" ); do
|
||||||
cd "$DIR/../demo-shell-ng2"
|
echo "Link dependencies of $components_dir/$comp_dir"
|
||||||
for PACKAGE in \
|
test -f "$components_dir/$comp_dir/package.json" && link_alfresco_ng2_deps "$components_dir/$comp_dir"
|
||||||
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 "====== demo shell linking: ${PACKAGE} ====="
|
|
||||||
npm link ${PACKAGE}
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Now run postinstall scripts
|
||||||
|
for comp_dir in $( ls "$components_dir" ); do
|
||||||
|
echo "Postinstall $components_dir/$comp_dir"
|
||||||
|
test -f "$components_dir/$comp_dir/package.json" && cd "$components_dir/$comp_dir" && npm run postinstall
|
||||||
|
done
|
||||||
|
|
||||||
|
# LINK ALL THE COMPONENTS INSIDE THE DEMOSHELL
|
||||||
|
link_alfresco_ng2_deps "$DIR/../demo-shell-ng2"
|
||||||
|
Reference in New Issue
Block a user