autoinstall/autoinstall/env_command.sh

17 lines
294 B
Bash

#!/usr/bin/env bash
target=${args[target]:?}
template=${args[template]:?}
if [ ! -f "$target" ]
then
echo "Installing env-template $template to $target"
target_dir=$(dirname "$target")
mkdir -p "$target_dir"
cd "$target_dir" || exit 1
envsubst < "$template" > "$target"
_run_hook
fi