Refactor directory creation in project-init

This commit is contained in:
coolneng 2022-10-20 09:00:05 +02:00
parent 403272e426
commit 1d2e5d0571
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 14 additions and 5 deletions

View File

@ -34,6 +34,12 @@ direnv_integration() {
direnv allow
}
create_dir() {
if [ ! -d "$1" ]; then
mkdir "$1"
fi
}
if [ $# != 1 ]; then
usage
fi
@ -41,24 +47,27 @@ fi
type=$1
if [ "$type" = "git" ]; then
mkdir src data
copy_nix_files "flake"
create_dir data
create_dir src
git_initialization
direnv_integration "flake"
elif [ "$type" = "remote-git" ]; then
touch README.org
cp ~/Documents/IT/gpl-3.0.md LICENSE.md
copy_nix_files "flake"
mkdir src tests data
create_dir data
create_dir src
git_initialization
direnv_integration "flake"
elif [ "$type" = "doc" ]; then
mkdir docs docs/assets
touch docs/Summary.org
create_dir assets
touch Report.org
touch .project
elif [ "$type" = "src" ]; then
copy_nix_files "nix"
mkdir src data
create_dir data
create_dir src
touch .project
direnv_integration "nix"
elif [ "$type" = "nix-ld" ]; then