Skip to content

Commit

Permalink
Add: clean pkg mgmt deps script
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Sep 8, 2023
1 parent 97e841a commit 6898f37
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
41 changes: 41 additions & 0 deletions scripts/clean-pkg-mgmt-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

targetPath=$1

echo "Delete package manager dependencies in '$targetPath'..."
directories=$(find $targetPath -type d)

# Gehe durch die Liste der Verzeichnisse und lösche alle Ordner, die den exakten Namen "node_modules", "packages" oder "include/lib" haben.
for directory in $directories; do
# NPM
if [[ "$directory" == "node_modules" ]]; then
if [[ -f "$directory/../package.json" ]]; then
echo "Deleting node_modules '$directory'..."
rm -rf $directory
else
echo "Skipping node_modules '$directory' because no package.json file was found."
fi
fi

# DOTNET/C#
if [[ "$directory" == "packages" ]]; then
if [[ -f "$directory/../packages.config" ]]; then
echo "Deleting packages '$directory'..."
rm -rf $directory
else
echo "Skipping packages '$directory' because no packages.config file was found."
fi
fi

# C++
if [[ "$directory" == "include" || "$directory" == "lib" ]]; then
if [[ -f "$directory/../CMakeLists.txt" ]]; then
echo "Deleting include/lib '$directory'..."
rm -rf $directory
else
echo "Skipping include/lib '$directory' because no CMakeLists.txt file was found."
fi
fi
done

echo "Done!"
4 changes: 2 additions & 2 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

if [ -z $START_PORT ]; then
docker rm -f codeccli-start-port-reader > /dev/null 2>&1

echo "test: $CODEC_USER_DATA"
START_PORT="$(
docker run -it --rm \
--name "codeccli-start-port-reader" \
Expand Down Expand Up @@ -235,7 +235,7 @@ docker run -it --rm \
-v "$CODEC_USER_DATA/$1:/codec" \
ubuntu:22.04 \
bash -c \
"chmod 777 /codec/.codec/ports.info.txt && echo '$PORT_INFO_TEXT' > /codec/.codec/ports.info.txt"
"chmod 777 /codec/.codec && echo '$PORT_INFO_TEXT' > /codec/.codec/ports.info.txt && chmod 744 /codec/.codec"

echo "[CODEC_CLI][START]: Save startup arguments..."
docker rm -f codeccli-port-helper > /dev/null 2>&1
Expand Down

0 comments on commit 6898f37

Please sign in to comment.