This commit is contained in:
@ -12,6 +12,10 @@ _autocommandrun_volume() {
|
||||
|
||||
case "$command" in
|
||||
create)
|
||||
if docker volume ls | grep -q ${volume_name}; then
|
||||
echo "Volume ${volume_name} already exists - leaving unchanged"
|
||||
return
|
||||
fi
|
||||
echo "Creating volume ${volume_name}"
|
||||
docker volume create ${volume_name}
|
||||
;;
|
||||
@ -39,6 +43,10 @@ _autocommandrun_path() {
|
||||
|
||||
case "$command" in
|
||||
create)
|
||||
if [ -d "${path}" ]; then
|
||||
echo "Path ${path} already exists - unchanged"
|
||||
return
|
||||
fi
|
||||
echo "Creating path ${path}"
|
||||
mkdir -p ${path}
|
||||
;;
|
||||
@ -80,6 +88,12 @@ _autocommandrun_file() {
|
||||
|
||||
case "$command" in
|
||||
create)
|
||||
filepath_parent=$(dirname ${filepath})
|
||||
filepath_child=$(basename ${filepath})
|
||||
if [ ! -d "${filepath_parent}" ]; then
|
||||
echo "Parent directory ${filepath_parent} of ${filepath_child} does not exist - creating"
|
||||
mkdir -p ${filepath_parent}
|
||||
fi
|
||||
;;
|
||||
nuke)
|
||||
rm -f ${filepath}
|
||||
|
Reference in New Issue
Block a user