refactor(setup.sh): make .env easier to setup

This commit is contained in:
matt1432 2023-03-14 23:00:58 -04:00
parent 3da4364871
commit 142cf84612
2 changed files with 8 additions and 7 deletions

8
getenv.sh Normal file
View file

@ -0,0 +1,8 @@
#!/bin/bash
if [ ! -f ~/.env ] ; then
cat << EOF >> ~/.env
SERV_COLOR="32"
USER="$USER"
EOF
fi

View file

@ -9,14 +9,7 @@ TODELETE="$(command ls --almost-all files) .PS1"
cp -r ./files/. /root cp -r ./files/. /root
for f in ./files/.*; do if [[ -f $f ]]; then ln ./$f ../../ ; fi; done for f in ./files/.*; do if [[ -f $f ]]; then ln ./$f ../../ ; fi; done
# dotenv
if [ ! -f ../../.env ] ; then
cat << EOF >> ../../.env
SERV_COLOR="32"
EOF
fi
source ./setenv.sh source ./setenv.sh
chown $USER:$USER ../../.env
## root PS1 ## root PS1
RED="01;31m" RED="01;31m"