Вы не можете выбрать более 25 тем
Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
|
- #!/bin/bash
- DIRECTORY=$(cd `dirname $0` && pwd)
- IMAGES_DIRECTORY=$DIRECTORY'/../src/assets/images/'
- AUDIOS_DIRECTORY=$DIRECTORY'/../public/audio/'
-
- ICONO_HEADER='icono_1.png'
- ICONO_FOOTER='icono_2.png'
-
- display_usage(){
- echo ""
- echo " webbandd script"
- echo ""
- echo " usage : webbandd.sh <input_directory>"
- echo ""
- echo " <input_directory> must contains :"
- echo " - two image files : icono_1.png & icono_2.png"
- echo " - one folder per album with mp3 and/or wav audio files"
- echo ""
- }
-
- error(){
- echo ""
- echo " Weband ERROR :"
- echo ""
- echo " "$1
- echo ""
- }
-
- # 1 argument required
- if [ $# -ne 1 ]
- then
- display_usage
- exit 1
- fi
-
-
-
-
- # check_image(){
- # if [[ -e $1'.svg' || -e $1'.png' || -e $1'.jpg' ]]
- # then
- # return 0
- # else
- # error $1' image file is missing !'
- # exit -1
- # fi
- # }
-
- check_image(){
- if [ -e $1 ]
- then
- return 0
- else
- error $1' image file is missing !'
- exit -1
- fi
- }
-
- check_image $1'/'$ICONO_HEADER
- echo " => "$1'/'$ICONO_HEADER" image exists - OK "
- check_image $1'/'$ICONO_FOOTER
- echo " => "$1'/'$ICONO_FOOTER" image exists - OK "
-
- #copy images (cover and contact)
- cp $1'/'$ICONO_HEADER $IMAGES_DIRECTORY
- cp $1'/'$ICONO_FOOTER $IMAGES_DIRECTORY
-
- if [ -d $AUDIOS_DIRECTORY ]
- then
- rm -rf $AUDIOS_DIRECTORY
- fi
-
- mkdir $AUDIOS_DIRECTORY
-
-
-
- for d in `find $1/* -type d`
- do
- echo ' copying audio directory "'$d'"'
- cp -r $d $AUDIOS_DIRECTORY
- done
-
- echo " => audio files copy - OK "
-
- node $DIRECTORY'/weband-id3-to-json.js'
|