Implement a small setup utility that prepares the repository with the dataset-related folders the verifier expects.
Requirements
Create an executable shell script at /app/setup.sh.
When run with no arguments, the script must ensure the following directories exist at the repository root (i.e., sibling to /app/):
data
embedding
evaluation
If any of these directories is missing, the script must create it. If they already exist, the script must leave them as-is (idempotent).
The script should create a small placeholder file in each directory (for example, README or .keep) so directories are non-empty.
The script must exit with status 0 on success and non-zero on unrecoverable errors.
The script should be safe to run multiple times (no errors if directories already exist).
Keep the implementation simple and portable (POSIX-compatible shell).
Expected usage
Run: /app/setup.sh
Outcome: The three directories will exist at the repository root and contain a small placeholder file. The script prints a short, human-friendly message indicating success and returns exit code 0.
Notes about locations and naming
The solution file must be placed at /app/setup.sh (executable).
The directories to be created must be at the repository root (not inside /app/).
Tests
The following test script will be used to verify your solution:
bash
#!/bin/bash
if [[ -d data ]] && [[ -d embedding ]] && [[ -d evaluation ]]; then
echo "data exist"
exit 0
else
wget -c http://paddlepaddle.bj.bcebos.com/dataset/webqa/WebQA.v1.0.zip
fi
if [[ `md5sum -c md5sum.txt` =~ 'OK' ]] ; then
unzip WebQA.v1.0.zip
mv WebQA.v1.0/* .
rmdir WebQA.v1.0
rm WebQA.v1.0.zip
else
echo "download data error!" >> /dev/stderr
exit 1
fi