Skip to content

Commit

Permalink
build: added update-deps.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Jan 11, 2023
1 parent 458e9d2 commit f7d34a1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions scripts/update-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Update dependency locks for each submodule in the activitywatch repo

set -e
set -x

# For submodule in submodules:
for submodule in $(git submodule | sed 's/^[+ ]//' | cut -d' ' -f2); do
# Go to submodule
cd $submodule

# Check that we're on the master branch and latest commit
if [ $(git rev-parse --abbrev-ref HEAD) != "master" ]; then
echo "Submodule $submodule is not on master branch, aborting"
exit 1
fi

# Update dependency locks
# Use poetry if poetry.lock exists, or cargo if Cargo.toml exists
if [ -f "poetry.lock" ]; then
poetry update
elif [ -f "Cargo.toml" ]; then
cargo update
fi

# Go back to root
cd ..
done

0 comments on commit f7d34a1

Please sign in to comment.