1#!/bin/sh
2# SPDX-License-Identifier: CC0-1.0
3
4# set the default value
5XDG_DATA_DIRS="${XDG_DATA_DIRS:-/usr/local/share/:/usr/share}"
6
7# add a directory if it exists
8if [ -d /opt/foo/share ]; then
9    XDG_DATA_DIRS="/opt/foo/share:${XDG_DATA_DIRS}"
10fi
11
12# write our output
13echo "XDG_DATA_DIRS=${XDG_DATA_DIRS}"
14