switch from env to json

This commit is contained in:
lou 2024-10-15 19:34:38 -04:00
parent 0782c9212e
commit 4b1aa70d36

16
manage
View File

@ -1,9 +1,5 @@
#!/bin/bash #!/bin/bash
if [ -f .env ]; then
export "$(grep -v '^#' .env | xargs)"
fi
PORT=3000 PORT=3000
SETUP_FILE=".setup_complete" SETUP_FILE=".setup_complete"
COLOR_RESET="\033[0m" COLOR_RESET="\033[0m"
@ -51,15 +47,15 @@ function install_tools() {
echo echo
sudo apt-get update sudo apt-get update
sudo apt-get install npm sudo apt-get install npm
echo -e "${COLOR_BLUE}Copying env file...${COLOR_RESET}" if [ ! -d "./config.json" ]; then
if [ ! -d "./.env" ]; then echo -e "${COLOR_BLUE}Copying config file...${COLOR_RESET}"
if [ ! -d "./.env.example" ]; then if [ ! -d "./config.json.example" ]; then
echo "Couldn't find example env file" echo "Couldn't find example config file"
else else
sudo cp .env.example .env sudo cp config.json.example config.json
fi fi
else else
echo -e "${COLOR_GREEN}env file already exists, skipping.${COLOR_RESET}" echo -e "${COLOR_GREEN}config file already exists, skipping.${COLOR_RESET}"
fi fi
echo -e "${COLOR_BLUE}Installing NPM deps...${COLOR_RESET}" echo -e "${COLOR_BLUE}Installing NPM deps...${COLOR_RESET}"
npm install > node.log 2>&1 npm install > node.log 2>&1