Refactor directory creation in project-init
This commit is contained in:
parent
403272e426
commit
1d2e5d0571
|
@ -34,6 +34,12 @@ direnv_integration() {
|
||||||
direnv allow
|
direnv allow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_dir() {
|
||||||
|
if [ ! -d "$1" ]; then
|
||||||
|
mkdir "$1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
if [ $# != 1 ]; then
|
if [ $# != 1 ]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
@ -41,24 +47,27 @@ fi
|
||||||
type=$1
|
type=$1
|
||||||
|
|
||||||
if [ "$type" = "git" ]; then
|
if [ "$type" = "git" ]; then
|
||||||
mkdir src data
|
|
||||||
copy_nix_files "flake"
|
copy_nix_files "flake"
|
||||||
|
create_dir data
|
||||||
|
create_dir src
|
||||||
git_initialization
|
git_initialization
|
||||||
direnv_integration "flake"
|
direnv_integration "flake"
|
||||||
elif [ "$type" = "remote-git" ]; then
|
elif [ "$type" = "remote-git" ]; then
|
||||||
touch README.org
|
touch README.org
|
||||||
cp ~/Documents/IT/gpl-3.0.md LICENSE.md
|
cp ~/Documents/IT/gpl-3.0.md LICENSE.md
|
||||||
copy_nix_files "flake"
|
copy_nix_files "flake"
|
||||||
mkdir src tests data
|
create_dir data
|
||||||
|
create_dir src
|
||||||
git_initialization
|
git_initialization
|
||||||
direnv_integration "flake"
|
direnv_integration "flake"
|
||||||
elif [ "$type" = "doc" ]; then
|
elif [ "$type" = "doc" ]; then
|
||||||
mkdir docs docs/assets
|
create_dir assets
|
||||||
touch docs/Summary.org
|
touch Report.org
|
||||||
touch .project
|
touch .project
|
||||||
elif [ "$type" = "src" ]; then
|
elif [ "$type" = "src" ]; then
|
||||||
copy_nix_files "nix"
|
copy_nix_files "nix"
|
||||||
mkdir src data
|
create_dir data
|
||||||
|
create_dir src
|
||||||
touch .project
|
touch .project
|
||||||
direnv_integration "nix"
|
direnv_integration "nix"
|
||||||
elif [ "$type" = "nix-ld" ]; then
|
elif [ "$type" = "nix-ld" ]; then
|
||||||
|
|
Loading…
Reference in New Issue