-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
40 lines (35 loc) · 712 Bytes
/
install.sh
File metadata and controls
40 lines (35 loc) · 712 Bytes
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
PATH_TRY="$HOME/.gitSync/gitSync.sh"
if [ ! -f $PATH_TRY ]; then
PATH_TRY="gitSync.sh"
if [ ! -f $PATH_TRY ]; then
read -p "Location of gitSync:" -r
echo
PATH_TRY = $REPLY
fi
fi
if [ ! -f $PATH_TRY ]
then
echo "gitSync not found, move my to ~/ please"
return 0
fi
grep 'gitSync' $HOME/.zshrc > /dev/null 2>&1
retval=$?
if [ "$retval" = 0 ]
then
echo "ok"
else
echo "NOK"
fi
read -p "Git server (https://github.com for syntax exemple):" -r
echo
addr="$REPLY/"
read -p "Git pseudo:" -r
echo
addr="$addr$REPLY/"
read -p "Git repository name for sync:" -r
echo
addr="myGit='$addr$REPLY.git'"
#echo "ADDR="$addr" PATH="$PATH_TRY
sed -i '2s|.*|'"$addr"'|' "$PATH_TRY"
source $HOME/.zshrc