-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrun
executable file
·40 lines (38 loc) · 1.42 KB
/
run
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
#!/bin/bash
LOGFILE=${LOGFILE:-"/var/log/homebrew-bottles.log"}
if [ "$RUN_LINUXBREW" = true ] ; then
# linuxbrew
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
(
cd /home/linuxbrew/.linuxbrew/homebrew/Library/Taps/homebrew/homebrew-core
if [ ! -z $HOMEBREW_TAP ]; then
git remote set-url origin git://github.com/Homebrew/linuxbrew-${HOMEBREW_TAP}.git
fi
echo "===== SYNC STARTED AT $(date -R) ====="
echo "> update package info..."
git fetch --depth=1 origin master
git reset --hard origin/master
echo ""
echo "> RUN brew bottle-mirror..."
brew bottle-mirror linux
echo "===== SYNC FINISHED AT $(date -R) ====="
) 2>&1 | tee $LOGFILE
else
# homebrew
eval $(/home/homebrew/.linuxbrew/bin/brew shellenv)
(
cd /home/homebrew/.linuxbrew/homebrew/Library/Taps/homebrew/homebrew-core
if [ ! -z $HOMEBREW_TAP ]; then
git remote set-url origin git://github.com/Homebrew/homebrew-${HOMEBREW_TAP}.git
fi
echo "===== SYNC STARTED AT $(date -R) ====="
echo "> update package info..."
git fetch --depth=1 origin master
git reset --hard origin/master
echo ""
echo "> RUN brew bottle-mirror..."
brew bottle-mirror mac
echo "===== SYNC FINISHED AT $(date -R) ====="
) 2>&1 | tee $LOGFILE
fi
savelog -c 50 $LOGFILE > /dev/null