forked from swiftlyfalling/SQLiteLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcopyExampleConfiguration.sh
More file actions
executable file
·34 lines (31 loc) · 964 Bytes
/
copyExampleConfiguration.sh
File metadata and controls
executable file
·34 lines (31 loc) · 964 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
#!/bin/sh
# Copies example .xcconfig file if no user configuration is present
copiedfiles=false
for ((i=0; i < SCRIPT_INPUT_FILE_COUNT ; i++))
do
INFILE=SCRIPT_INPUT_FILE_$i
EXAMPLEFILE=${!INFILE};
OUTPUTFILE=${EXAMPLEFILE%.example}
echo "${INFILE}=${EXAMPLEFILE}"
if [ -f "$EXAMPLEFILE" ]
then
if [ ! -f "$OUTPUTFILE" ];
then
echo "Expected USER configuration file doesn't exist"
echo "Copying .example file"
cp $EXAMPLEFILE $OUTPUTFILE
touch $OUTPUTFILE
copiedfiles=true
else
echo "USER Configuration file already exists: ${OUTPUTFILE}"
echo "Skipping .example copy."
fi
else
echo "Missing input .example file: ${EXAMPLEFILE}"
exit 1
fi
done
if [ "$copiedfiles" = true ] ; then
touch "${SRCROOT}/SQLiteLib.xcconfig"
sleep 1
fi