-
Notifications
You must be signed in to change notification settings - Fork 0
/
link-speechly-sources.sh
executable file
·74 lines (56 loc) · 1.64 KB
/
link-speechly-sources.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# See end of file for calls to linkSource
linkSource () {
HARDLINK_SOURCE=$1
HARDLINK_DEST=$2
if [ ! -d "$HARDLINK_SOURCE" ]; then
echo "ERROR: Source folder '$HARDLINK_SOURCE' does not exist"
exit 1
fi
pushd $HARDLINK_SOURCE
ABS_HARDLINK_SOURCE=`pwd`
popd
if [ -e "$HARDLINK_DEST" ]; then
echo
echo ============ LOCAL CHANGES IN ============
rsync -au --out-format="%n" --dry-run --exclude "*.meta" $HARDLINK_DEST/* $ABS_HARDLINK_SOURCE
echo ==========================================
echo LOCAL: $HARDLINK_DEST
echo
read -p "Do you wish to backport? [y/n] " yn
if echo "$yn" | grep -iq "^y" ;then
rsync -au -vv --exclude "*.meta" $HARDLINK_DEST/* $ABS_HARDLINK_SOURCE | grep "is newer"
fi
echo
echo "WARNING: Replacing previous content:"
ls $HARDLINK_DEST
read -p "Do you wish to proceed? [y/n] " yn
if ! echo "$yn" | grep -iq "^y" ;then
echo "Cancelled"
exit 1
fi
rm -rf $HARDLINK_DEST
fi
mkdir -p $HARDLINK_DEST
pushd $HARDLINK_DEST
ABS_HARDLINK_DEST=`pwd`
popd
echo
echo Linking content from:
echo $ABS_HARDLINK_SOURCE
echo
echo To:
echo $HARDLINK_DEST
echo
pushd $ABS_HARDLINK_SOURCE
pax -rwl . $ABS_HARDLINK_DEST
popd
echo
echo "OK"
}
HARDLINK_SOURCE="speechly-dotnet/Speechly/SpeechlyClient"
HARDLINK_DEST="speechly-unity/Assets/Speechly/SpeechlyClient"
linkSource $HARDLINK_SOURCE $HARDLINK_DEST
HARDLINK_SOURCE="speechly-dotnet/Speechly/SpeechlyClientTest"
HARDLINK_DEST="speechly-unity/Assets/Speechly/Examples/AudioFileToSpeechly/SpeechlyClientTest"
linkSource $HARDLINK_SOURCE $HARDLINK_DEST