-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ubuntu
committed
Sep 8, 2023
1 parent
97e841a
commit 6898f37
Showing
2 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters