-
Notifications
You must be signed in to change notification settings - Fork 1
/
refresh-all
executable file
·60 lines (52 loc) · 1.35 KB
/
refresh-all
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
#!/bin/bash
# for a in `find . -mindepth 1 -maxdepth 1 -type d`
echo -n fetching Helios repo list...
REPOS=$(
curl --silent https://github.com/orgs/HeliosLang/repositories.json | jq -r '.payload.repositories[].name'
)
if [[ $? -ne 0 ]] ; then {
echo
echo "Error: failed fetching Helios repo list ... are you online?" >&2
exit 1
} fi
echo "ok"
echo
# set -x
for REPO_NAME in $REPOS ; do {
# echo $REPO_NAME
TARGET_DIR="${REPO_NAME}"
LABEL=$REPO_NAME
if [[ "workspace" == "${REPO_NAME}" ]] ; then
TARGET_DIR="."
LABEL="workspace in ./"
else {
if [[ -d $REPO_NAME ]] ; then true
else {
set -e
git clone https://github.com/HeliosLang/$REPO_NAME
set +e
} ; fi
} ; fi
pushd $TARGET_DIR >/dev/null
{
git fetch --all | while read content ; do {
printf "%22s | %s\n" "$LABEL" "$content"
} done
git pull | while read content ; do {
printf "%22s | %s\n" "$LABEL" "$content"
} done
} 2> >(
while read err ; do {
printf "ERROR %16s | %s\n" "$LABEL" "$err" >&2
} done
) &
popd >/dev/null
} done
wait
echo
echo "All repos fetched and updated."
echo "Next: install dependencies (Ctrl-C to cancel) for all repos"
echo
read -p"Next: $ " -e -i"pnpm install" COMMAND_IGNORED
pnpm install
echo