Skip to content
Snippets Groups Projects
Commit 9b556d45 authored by Anthony's avatar Anthony
Browse files

WIP cli

parent 6c6e679d
No related branches found
No related tags found
1 merge request!15Draft : Resolve "Add a CLI tool"
...@@ -17,8 +17,8 @@ cmdup="docker-compose up" ...@@ -17,8 +17,8 @@ cmdup="docker-compose up"
cmddown="docker-compose down" cmddown="docker-compose down"
cmdinitsubmodule="git submodule init" cmdinitsubmodule="git submodule init"
cmdupdatetsubmodule="git submodule update" cmdupdatetsubmodule="git submodule update"
cmdbuildmirador="docker run --rm -v mirador-video-annotation:/opt -it node:12 /bin/sh -c 'cd /opt && npm install && npm run build:es'" cmdbuildmirador="'"
cmdbuildmiradorplugin="docker run --rm -v annotations-plugin:/opt -it node:12 /bin/sh -c 'cd /opt && npm install && npm run build'" cmdbuildmiradorplugin=""
MIRADOR_FOLDER=mirador-video-annotation MIRADOR_FOLDER=mirador-video-annotation
MIRADOR_ANNOTATION_FOLDER=annotations-plugin MIRADOR_ANNOTATION_FOLDER=annotations-plugin
...@@ -28,10 +28,10 @@ shift ...@@ -28,10 +28,10 @@ shift
# Keep actions sorted # Keep actions sorted
case $action in case $action in
"build-mirador") "build-mirador")
cd $MIRADOR_FOLDER && $cmdbuildmirador cd $MIRADOR_FOLDER && docker run --rm -v $PWD:/opt -it node:12 /bin/sh -c 'cd /opt && npm install && npm run build:es'
;; ;;
"build-mirador-plugin") "build-mirador-plugin")
cd $MIRADOR_ANNOTATION_FOLDER && $cmdbuildmiradorplugin cd $MIRADOR_ANNOTATION_FOLDER && docker run --rm -v $PWD:/opt -it node:12 /bin/sh -c 'cd /opt && npm install && npm run build'
;; ;;
"clean-mirador") "clean-mirador")
cd $MIRADOR_FOLDER && rm -R -f node_modules package-lock.json cd $MIRADOR_FOLDER && rm -R -f node_modules package-lock.json
...@@ -53,7 +53,7 @@ case $action in ...@@ -53,7 +53,7 @@ case $action in
;; ;;
"install") "install")
echo "** Start install ..." echo "** Start install ..."
FILE=.env FILE='.env'
if [ ! -f "$FILE" ]; then if [ ! -f "$FILE" ]; then
echo "** $FILE does not exist. Please copy .env template. [cp .env.template .env] and set COMPOSE_FILE to suit your needs" echo "** $FILE does not exist. Please copy .env template. [cp .env.template .env] and set COMPOSE_FILE to suit your needs"
exit 0 exit 0
...@@ -64,10 +64,10 @@ case $action in ...@@ -64,10 +64,10 @@ case $action in
$cmdupdatesubmodule $cmdupdatesubmodule
echo "** Submodule initialized" echo "** Submodule initialized"
echo "** Building Mirador ..." echo "** Building Mirador ..."
$cmdbuildmirador cd $MIRADOR_FOLDER && docker run --rm -v $PWD:/opt -it node:12 /bin/sh -c 'cd /opt && npm install && npm run build:es'
echo "** Mirador build." echo "** Mirador build."
echo "** Building Mirador plugin ..." echo "** Building Mirador plugin ..."
$cmdbuildmiradorplugin cd $MIRADOR_ANNOTATION_FOLDER && docker run --rm -v $PWD:/opt -it node:12 /bin/sh -c 'cd /opt && npm install && npm run build'
echo "** Mirador plugin build." echo "** Mirador plugin build."
;; ;;
"up") "up")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment