This repository was archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink-react-ui.sh
More file actions
executable file
·68 lines (54 loc) · 1.43 KB
/
link-react-ui.sh
File metadata and controls
executable file
·68 lines (54 loc) · 1.43 KB
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
#!/bin/bash
source .env
if [ -z "$SPEECHLY_REACT_UI_PATH" ]
then
echo "ERROR: Environment variable SPEECHLY_REACT_UI_PATH needs to be set either in the shell or in .env file"
exit 1
fi
HARDLINK_SOURCE=$SPEECHLY_REACT_UI_PATH/src
# /Users/arzga/Documents/Speechly/git/react-ui/components/src/components
HARDLINK_DEST=src/@speechly/react-ui/
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 $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 $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"