-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathneed-commits
More file actions
executable file
·64 lines (54 loc) · 1.5 KB
/
need-commits
File metadata and controls
executable file
·64 lines (54 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
source ./functions.sh
source .fork-config
# HAVE_DIFFS=$(./gsall 2>/dev/null | cut -d ' ' -f1 | uniq )
gitStatus() {
git -c color.ui=always status --short -b | labeledOutput $LABEL
}
gitStatusPlain() {
git status --short -b | labeledOutput $DIR
}
# eachRepo parallel buffered "checking \`git status\` in each repo" gitStatus
HAVE_DIFFS=$(
eachRepo parallel buffered "project with diffs" gitStatusPlain | cut -d ' ' -f1 | uniq
)
# echo "$HAVE_DIFFS"
filters=$(
echo "$HAVE_DIFFS" | while read REPO ; do {
echo "--filter $REPO"
} done
)
# echo "Repos with changes to be committed:"
# echo "$HAVE_DIFFS" | while read REPO; do
# echo " - $REPO"
# done
NEED=$(
pnpm -r $filters exec bash -c 'basename $(pwd)' 2> >(labeledErrors "pnpm") | grep -v "No projects matched"
)
# pnpm -r $filters exec $COMMIT_TOOL
show() {
echo "Reviewing repos with changes to be committed:"
echo
echo "$NEED" | while read REPO; do
echo " - $REPO"
done
echo
}
show
for a in $NEED; do
echo " $a"
# wait for 3 seconds before automatically moving to the next repo
read -p "Press Enter to continue or Ctrl-C to exit "
pushd $a >/dev/null
LABEL=$a gitStatus
pnpm install --ignore-workspace
pnpm build
echo "Spawning bash for $a ..."
echo " ... exit the shell when done committing ..."
$COMMIT_TOOL --noprofile
popd >/dev/null
echo
echo "... done with $a"
done
echo "Rerun ./need-commits to review remaining repos"
exit