Skip to content

Commit

Permalink
Merge pull request #27 from maykinmedia/chore/add-conflicting-depende…
Browse files Browse the repository at this point in the history
…ncies-removal-script

🔧 Add frontend/bin/remove_conflicting_devdependencies.sh (fixe…
  • Loading branch information
svenvandescheur authored May 16, 2024
2 parents 246950c + 9ab4cf5 commit 3c778ac
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions frontend/bin/remove_conflicting_devdependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# Get the directory of the script
SCRIPT_DIR=`dirname $0`;
FRONTEND_DIR=`dirname $SCRIPT_DIR`

cd $FRONTEND_DIR;

CONFLICTS=("@maykin-ui/admin-ui/node_modules/react" "@maykin-ui/admin-ui/node_modules/react-dom")

# Function to check if a directory exists
function directory_exists() {
[ -d $1 ]
}

count=0;
for dir in ${CONFLICTS[@]}; do
fulldir="node_modules/${dir}"

if directory_exists $fulldir; then
echo "removing conflicting dependency: $fulldir"
rm -rf $fulldir;
let count++
else
echo "conflicting dependency not found: $fulldir"
fi
done

echo ""
echo "$count conflicting dependencies removed"

if [ $count -gt 0 ]; then
echo "you may need to restart your server"
fi

0 comments on commit 3c778ac

Please sign in to comment.