Add remote-git option in project-init

This commit is contained in:
coolneng 2020-12-16 17:54:33 +01:00
parent f05cde75a3
commit a6196c344e
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 28 additions and 19 deletions

View File

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