Skip to content

Commit

Permalink
fix: optimize home resource for fe env
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Nov 5, 2024
1 parent 22ed130 commit 2afca54
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions setup/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,11 @@ home_resource_env() {

HOME_RESOURCE_DIR="$HOME_DIR/home-resource"



# check and replace "PUBLIC_DIR=/Users/tanhongit/Data/CSlant/home-resource/public" to "PUBLIC_DIR=$HOME_RESOURCE_DIR/public"
if [ -f "$HOME_FE_DIR/.env" ]; then
if ! grep -q "PUBLIC_DIR=$HOME_RESOURCE_DIR/public" "$HOME_FE_DIR/.env"; then
echo ' ∟ Setting up PUBLIC_DIR...'
sed -i '' "s|PUBLIC_DIR=.*|PUBLIC_DIR=$HOME_RESOURCE_DIR/public|g" "$HOME_FE_DIR/.env"
fi
if [ -f "$HOME_FE_DIR/.env" ] && ! grep -q "PUBLIC_DIR=$HOME_RESOURCE_DIR/public" "$HOME_FE_DIR/.env"; then
echo ' ∟ Setting up PUBLIC_DIR...'
sed -i '' "s|PUBLIC_DIR=.*|PUBLIC_DIR=$HOME_RESOURCE_DIR/public|g" "$HOME_FE_DIR/.env"
else
echo ' ∟ PUBLIC_DIR already set up...'
fi
}

0 comments on commit 2afca54

Please sign in to comment.