-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject-symlink.sh
executable file
·50 lines (36 loc) · 1.48 KB
/
project-symlink.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
#!/bin/bash
PROOT=`pwd`
SROOT=`dirname $(readlink -f "$0")`
################################################################################
################################################################################
echo "ProjectRoot: $PROOT"
echo "SourceRoot: $SROOT"
echo ""
echo "This will delete some files from your ProjectRoot and symlink them with their counterparts in the SourceRoot."
echo ""
read -p "Are you sure? [y/n] " -n 2 -r
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo "Laters."
exit 1
fi
################################################################################
################################################################################
echo "Symlinking in www/index.php..."
rm $PROOT/www/index.php
ln -s $SROOT/app/www/index.php $PROOT/www/index.php
# these are thandled by atlanits.json now by default for porjects.
#echo "Symlinking in www/themes/default..."
#rm -rf $PROOT/www/themes/default
#ln -s $SROOT/app/www/themes/default $PROOT/www/themes/default
#echo "Symlinking in www/share..."
#rm -rf $PROOT/www/share
#ln -s $SROOT/app/www/share $PROOT/www/share
################################################################################
################################################################################
echo "Symlinking in routes/Home.php..."
rm $PROOT/routes/Home.php
ln -s $SROOT/app/routes/Home.php $PROOT/routes/Home.php
echo "Symlinking in routes/Docs.php..."
rm $PROOT/routes/Docs.php
ln -s $SROOT/app/routes/Docs.php $PROOT/routes/Docs.php