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

63 lines
2.2 KiB
Bash
Executable File

#!/usr/bin/env bash
create-dotenv() {
if [[ -z "$1" ]]; then
echo "\$1/env is empty."
exit
fi
if [[ -z "$2" ]]; then
echo "\$1/type 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