Script to fix submodules (#2018)
### Description I keep finding myself running a few commands in sequence because of the submodules so I figured it was about time to turn it into a script to make things easier for us. ### Drive-by changes None ### Related issues ### Backward compatibility _Are these changes backward compatible?_ Yes _Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling?_ None ### Testing _What kind of testing have these changes undergone?_ Manualpull/2190/head
parent
355b5ed44e
commit
95d8fdd330
@ -0,0 +1,33 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
# This is designed to synchronize the typescript submodules in the current state with the committed |
||||
# submodule version and then clean and build the typescript codebase. This will not update the |
||||
# submodules, only bring them to the same version as they are in `.gitmodules`. |
||||
|
||||
set -e |
||||
|
||||
DIRNAME=$(basename "$PWD") |
||||
if [[ "$DIRNAME" != "hyperlane-monorepo" ]]; then |
||||
echo "Must be run from the root of the monorepo" |
||||
exit 1 |
||||
fi |
||||
|
||||
DIRS=$(git submodule status | grep -oE "typescript/[a-zA-Z0-9_-]+") |
||||
for DIR in $DIRS ; do |
||||
echo "Removing '$DIR'" |
||||
rm -rf "$DIR" |
||||
done |
||||
|
||||
git submodule init |
||||
git submodule update |
||||
|
||||
for DIR in $DIRS ; do |
||||
echo "Cleaning '$DIR'" |
||||
pushd "$DIR" || continue |
||||
rm -rf yarn.lock node_modules |
||||
popd || exit 1 |
||||
done |
||||
|
||||
yarn clean |
||||
yarn install |
||||
yarn build |
Loading…
Reference in new issue