dotfiles/scripts/.local/share/scripts/project-init

51 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
usage() {
echo "Usage: project-init <type>"
echo "type git: VCS project"
echo "type remote-git: VCS project with README, LICENSE and tests"
echo "type src: Simple coding project"
echo "type doc: Assignment"
exit 1
}
if [ $# != 1 ]; then
usage
fi
type=$1
if [ "$type" = "git" ]; then
git init
cp ~/Documents/IT/shell.nix .
cp ~/Documents/IT/flake-template.nix.nix flake.nix
mkdir src data
git add ./*
git commit -m "Initial commit"
echo "use flake" >.envrc
direnv allow
elif [ "$type" = "remote-git" ]; then
git init
touch README.org
cp ~/Documents/IT/gpl-3.0.md LICENSE.md
cp ~/Documents/IT/shell.nix .
cp ~/Documents/IT/flake-template.nix.nix flake.nix
mkdir src tests data
git add ./*
git commit -m "Initial commit"
echo "use flake" >.envrc
direnv allow
elif [ "$type" = "doc" ]; then
mkdir docs docs/assets
touch docs/Summary.org
touch .project
elif [ "$type" = "src" ]; then
cp ~/Documents/IT/shell.nix .
mkdir src data
echo "use nix" >.envrc
touch .project
direnv allow
else
usage
fi