diff --git a/src/libs/bash/functions-common.sh b/src/libs/bash/functions-common.sh index 14eb12a..7485548 100644 --- a/src/libs/bash/functions-common.sh +++ b/src/libs/bash/functions-common.sh @@ -1,3 +1,4 @@ +# TODO: rename to Create folder for container function create_folder() { local path=$1 @@ -20,6 +21,19 @@ function symlink_folder() fi } +function ensure_folder(){ + local dst=$1 + + if [ ! -d "${}" ]; then + echo "Creating folder at path $(dst)" + mkdir -p "${dst}" + if [ ! $? -eq 0 ]; then + echo "Could not create folder, make sure you have the right permissions" + exit 1 + fi + fi +} + function ensure_file() { local src=$1 diff --git a/src/libs/bash/lib.sh b/src/libs/bash/lib.sh index 44a34e0..221b5aa 100644 --- a/src/libs/bash/lib.sh +++ b/src/libs/bash/lib.sh @@ -1,4 +1,8 @@ source /opt/kaido/src/libs/bash/envs.sh source /opt/kaido/src/libs/bash/functions-common.sh source /opt/kaido/src/libs/bash/functions-commands.sh -source /opt/kaido/src/libs/bash/functions-containers.sh \ No newline at end of file +source /opt/kaido/src/libs/bash/functions-containers.sh + +function kaido() { + /opt/kaido/kaido.sh $@ +} \ No newline at end of file