by_json: simplify way to change RERO-ils directory
This commit is contained in:
parent
23b6950f88
commit
ee9488ab7e
@ -11,11 +11,10 @@
|
|||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
* Open **commons.sh** file
|
|
||||||
* change **RERO\_DIR** variable to point your **rero-ils directory**
|
* change **RERO\_DIR** variable to point your **rero-ils directory**
|
||||||
|
|
||||||
```
|
```
|
||||||
make clean && make
|
make clean && RERO_DIR="/home/moi/rero/rero-ils" make
|
||||||
```
|
```
|
||||||
|
|
||||||
Result: **2 files (orgas.svg and policies.svg)** file (can be open with Gimp for example).
|
Result: **2 files (orgas.svg and policies.svg)** file (can be open with Gimp for example).
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
# Built variables
|
# Built variables
|
||||||
outputfile="$1"
|
outputfile="$1"
|
||||||
|
RERO_DIR="${RERO_DIR:-${HOME}/projets/rero/rero-ils}"
|
||||||
SRC_DIR="${RERO_DIR}/data/"
|
SRC_DIR="${RERO_DIR}/data/"
|
||||||
|
|
||||||
# Templates
|
# Templates
|
||||||
@ -32,6 +33,14 @@ elif [[ -f "${outputfile}" ]]; then
|
|||||||
echo "File already exists!"
|
echo "File already exists!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [[ ! -d "${RERO_DIR}" ]]; then
|
||||||
|
echo "Source directory doesn't exist: ${RERO_DIR}. Did you set RERO_DIR variable?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [[ ! -d "${SRC_DIR}" ]]; then
|
||||||
|
echo "No data directory found in ${RERO_DIR}. Did you set RERO_DIR variable correctly?"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# FUNCTIONS
|
# FUNCTIONS
|
||||||
# WRITE first argument in output file
|
# WRITE first argument in output file
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
# dot -Tsvg output.dot -o organisations.svg
|
# dot -Tsvg output.dot -o organisations.svg
|
||||||
# where `output.dot` is the previous file. And `organisations.svg` the final schema you want to display.
|
# where `output.dot` is the previous file. And `organisations.svg` the final schema you want to display.
|
||||||
|
|
||||||
# CONFIG
|
|
||||||
RERO_DIR="${HOME}/projets/rero/rero-ils"
|
|
||||||
|
|
||||||
# Load commons variables, functions and statements
|
# Load commons variables, functions and statements
|
||||||
source commons.sh
|
source commons.sh
|
||||||
|
|
||||||
|
@ -3,9 +3,6 @@
|
|||||||
# Generate a dot file to create graph of RERO-ils data
|
# Generate a dot file to create graph of RERO-ils data
|
||||||
#
|
#
|
||||||
|
|
||||||
# CONFIG
|
|
||||||
RERO_DIR="${HOME}/projets/rero/rero-ils"
|
|
||||||
|
|
||||||
# Load commons variables, functions and statements
|
# Load commons variables, functions and statements
|
||||||
source commons.sh
|
source commons.sh
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user