Update update-version.sh

[skip ci]
This commit is contained in:
Eugenio Romano 2020-10-09 18:47:01 +01:00 committed by GitHub
parent 9f67cae204
commit 877b889dfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,7 +6,6 @@ eval libs=( "@alfresco/adf-core"
"@alfresco/adf-content-services" "@alfresco/adf-content-services"
"@alfresco/adf-extensions" "@alfresco/adf-extensions"
"@alfresco/adf-testing" "@alfresco/adf-testing"
"@alfresco/js-api"
"@alfresco/adf-cli" "@alfresco/adf-cli"
) )
@ -16,12 +15,17 @@ show_help() {
echo "Usage: update-version.sh -v latest" echo "Usage: update-version.sh -v latest"
echo "" echo ""
echo "-v or -version the new version of the libraries, can also be alpha|beta|latest" echo "-v or -version the new version of the libraries, can also be alpha|beta|latest"
echo "-vj or --versionjsapi to use a different version of js-api"
} }
set_version() { set_version() {
VERSION=$1 VERSION=$1
} }
set_js_version() {
JS_VERSION=$1
}
update(){ update(){
eval libsWithVersions=(); eval libsWithVersions=();
@ -35,10 +39,18 @@ update(){
npm i --ignore-scripts -E ${libsWithVersions[*]} npm i --ignore-scripts -E ${libsWithVersions[*]}
} }
update_js_api(){
eval jsWithVersions=();
echo "npm i --ignore-scripts -E @alfresco/js-api@${JS_VERSION}"
npm i --ignore-scripts -E @alfresco/js-api@${JS_VERSION}
}
while [[ $1 == -* ]]; do while [[ $1 == -* ]]; do
case "$1" in case "$1" in
-h|--help|-\?) show_help; exit 0;; -h|--help|-\?) show_help; exit 0;;
-v|version) set_version $2; shift 2;; -v|version) set_version $2; shift 2;;
-vj|version) set_js_version $2; shift 2;;
-*) shift;; -*) shift;;
esac esac
done done
@ -53,3 +65,8 @@ libslength=${#libs[@]}
echo "====== Updating dependencies ======" echo "====== Updating dependencies ======"
update update
if [[ "${JS_VERSION}" != "" ]]
then
update_js_api
fi