Skip to content

Instantly share code, notes, and snippets.

@plskz
Last active March 13, 2024 07:11
Show Gist options
  • Save plskz/d1e8478625d499d4e309ef8e0f75188c to your computer and use it in GitHub Desktop.
Save plskz/d1e8478625d499d4e309ef8e0f75188c to your computer and use it in GitHub Desktop.
update all deps for my-threejs-journey repo
#!/bin/bash
# Loop through folders from 01 to 33
for folder_number in {1..33}; do
folder=$(printf "%02d-" "$folder_number") # Format folder number with leading zero
# Find folders with the given prefix
folders_with_prefix=$(find . -maxdepth 1 -type d -name "$folder*")
# Loop through folders with the given prefix
for current_folder in $folders_with_prefix; do
echo "Updating dependencies in $current_folder"
cd "$current_folder" || exit 1 # Change directory to the folder
# Check if package.json exists in the folder
if [ -f "package.json" ]; then
taze -w
ni
else
echo "No package.json found in $current_folder"
fi
cd .. # Move back to the parent directory
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment