From 142cf84612ac8a4ff1079799ba8bab0de88e7e98 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Tue, 14 Mar 2023 23:00:58 -0400 Subject: [PATCH] refactor(setup.sh): make .env easier to setup --- getenv.sh | 8 ++++++++ setup.sh | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 getenv.sh diff --git a/getenv.sh b/getenv.sh new file mode 100644 index 0000000..aeaca5d --- /dev/null +++ b/getenv.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +if [ ! -f ~/.env ] ; then +cat << EOF >> ~/.env +SERV_COLOR="32" +USER="$USER" +EOF +fi diff --git a/setup.sh b/setup.sh index 0165976..bba15cb 100644 --- a/setup.sh +++ b/setup.sh @@ -9,14 +9,7 @@ TODELETE="$(command ls --almost-all files) .PS1" cp -r ./files/. /root 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 -chown $USER:$USER ../../.env ## root PS1 RED="01;31m"