Files
git.taskfile.build/bin/create-dotenv
T

52 lines
2.1 KiB
Bash
Executable File

#!/usr/bin/env bash
create-dotenv() {
if [[ -z "$1" ]]; then echo "\$1 is empty."; exit; fi
if [[ -z "$2" ]]; then echo "\$1 is empty."; exit; fi
TASK_DOTENV_DIR=${TASK_DOTENV_DIR:="$HOME/.config/taskfile.build"}
init-dotenv-dir
local env_filepath="$TASK_DOTENV_DIR/.env.$1"
if [[ -f "$env_filepath" ]]; then
echo "Env file already exists: $env_filepath"
exit 1
fi
echo "Init .env file: $env_filepath"
if [[ "$2" == "odoo" ]]