taskflow/tools/update_states.sh
Zhao Lei c7c9647a0b Remove quotes from subshell call in bash script
Always no quotes for $() statement.

We don't need quotes to hold blanks in result:
 # i=$(echo 1 2 3)
 # echo $i
 1 2 3
 #

These quotes can make something wrong in some case:
 # i=$(echo '!')
 #
 # i="$(echo '!')"
 -bash: !: event not found
 #

No real problem for current code, only to use a better code style.

Change-Id: I0f43bb936f956c99603dc15aaad9db851ecf0acd
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2015-09-23 18:49:26 +08:00

41 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -u
xsltproc=`which xsltproc`
if [ -z "$xsltproc" ]; then
echo "Please install xsltproc before continuing."
exit 1
fi
set -e
if [ ! -d "$PWD/.diagram-tools" ]; then
git clone "https://github.com/vidarh/diagram-tools.git" "$PWD/.diagram-tools"
fi
script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
img_dir="$script_dir/../doc/source/img"
echo "---- Updating task state diagram ----"
python $script_dir/state_graph.py -t -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/task_states.svg
echo "---- Updating flow state diagram ----"
python $script_dir/state_graph.py -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/flow_states.svg
echo "---- Updating engine state diagram ----"
python $script_dir/state_graph.py -e -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/engine_states.svg
echo "---- Updating retry state diagram ----"
python $script_dir/state_graph.py -r -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/retry_states.svg
echo "---- Updating wbe request state diagram ----"
python $script_dir/state_graph.py -w -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/wbe_request_states.svg
echo "---- Updating job state diagram ----"
python $script_dir/state_graph.py -j -f /tmp/states.svg
$xsltproc $PWD/.diagram-tools/notugly.xsl /tmp/states.svg > $img_dir/job_states.svg