forked from adobe/brackets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_server_smokes.sh
executable file
·39 lines (31 loc) · 1.07 KB
/
setup_server_smokes.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
#!/bin/bash
# Make sure the server root folder was passed in and is valid
if [[ ${1} == "" ]]; then
echo "Usage: setup_server_smokes.sh <server-root-path>"
echo "Setup local server to access Brackets server smoke test files from GitHub"
echo ""
echo "Parameters: server-root-path - local file path to server root folder"
echo "Example: ./setup_server_smokes.sh \"/Library/WebServer/Documents\""
exit 0;
fi
if [ ! -d "${1}" ]; then
echo "$1 not found."
exit 1;
fi
# Get the full path of this script
if [[ ${0} == /* ]]; then
full_path="$0"
else
full_path="${PWD}/${0#./}"
fi;
# Remove /tools/setup_server_smokes.sh to get the root directory
root_dir=${full_path%/*/*}
# Add server-tests path to root directory to get test file directory
server_test_dir="$root_dir/test/smokes/server-tests"
# Remove existing "server-tests" symlink, if present
if [ -d "${1}/server-tests" ]; then
rm "${1}/server-tests" || exit 1;
fi
# Make new symlink
ln -s "$server_test_dir" "${1}/server-tests" || exit 1;
echo "Local server now has access to Brackets server-tests smoke test files"