-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimplant.sh
executable file
·52 lines (40 loc) · 1.14 KB
/
implant.sh
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
#!/bin/bash
# Copy the Repoint program files from the directory containing this
# script into the directory from which the script is run.
set -eu
src=$(dirname "$0")
target=$(pwd)
if [ ! -f "$src/repoint" ]; then
echo "Failed to find $src/repoint, giving up"
exit 2
fi
repointfiles="repoint repoint.bat repoint.ps1 repoint.sml"
echo -n "Copying Repoint files from $src to $target... "
for f in $repointfiles; do
cp "$src/$f" "$target/"
done
chmod +x "$target/repoint"
echo "Done"
vcs=""
if [ -d "$target/.hg" ]; then
vcs="Mercurial"
elif [ -d "$target/.git" ]; then
vcs="Git"
fi
if [ -n "$vcs" ]; then
echo -n "Add Repoint scripts to local $vcs repo? [yN] "
read answer
case "$answer" in
Y|y) ( cd "$target"
if [ -d ".hg" ]; then
hg add $repointfiles
echo 'glob:.repoint*' >> .hgignore
hg add .hgignore
elif [ -d ".git" ]; then
git add $repointfiles
echo '.repoint*' >> .gitignore
git add .gitignore
fi ) ; echo "Done" ;;
*) echo "Not adding to repo" ;;
esac
fi