56 lines
1.3 KiB
Bash
Executable File
56 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
init-project() {
|
|
git init --initial-branch=main .
|
|
|
|
local created=()
|
|
|
|
if [[ ! -d "tmp" ]]; then
|
|
mkdir -p tmp
|
|
created+=("tmp/")
|
|
fi
|
|
|
|
if [[ ! -f ".gitignore" ]]; then
|
|
cp "$HOME/taskfile.build/.gitignore.template" ./.gitignore
|
|
created+=(".gitignore")
|
|
fi
|
|
|
|
if [[ ! -f "task" ]]; then
|
|
cp "$HOME/taskfile.build/task.template" ./task
|
|
chmod +x ./task
|
|
created+=("task")
|
|
fi
|
|
|
|
if [[ ! -f ".env.template" ]]; then
|
|
cp "$HOME/taskfile.build/.env.template" ./.env.template
|
|
created+=(".env.template")
|
|
fi
|
|
|
|
if [[ ! -f "AGENTS.md" ]]; then
|
|
cp "$HOME/taskfile.build/AGENTS.md.template" ./AGENTS.md
|
|
created+=("AGENTS.md")
|
|
fi
|
|
|
|
if [[ ! -f "CHANGELOG.md" ]]; then
|
|
cp "$HOME/taskfile.build/CHANGELOG.md.template" ./CHANGELOG.md
|
|
created+=("CHANGELOG.md")
|
|
fi
|
|
|
|
if [[ ! -f "README.md" ]]; then
|
|
touch ./README.md
|
|
created+=("README.md")
|
|
fi
|
|
|
|
if [[ ! -f "LICENSE" ]] && [[ "$HOME/taskfile.build/LICENSE" != "$PWD/LICENSE" ]]; then
|
|
cp "$HOME/taskfile.build/LICENSE" ./LICENSE
|
|
created+=("LICENSE")
|
|
fi
|
|
|
|
if ((${#created[@]} > 0)); then
|
|
echo "Created: ${created[*]}"
|
|
fi
|
|
}
|
|
inp() {
|
|
init-project "$@"
|
|
}
|