-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhawcEndpointSummary.sh
More file actions
executable file
·54 lines (43 loc) · 1.25 KB
/
hawcEndpointSummary.sh
File metadata and controls
executable file
·54 lines (43 loc) · 1.25 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
#!/bin/bash
echo "Alternate approach..."
cd $HAWC_HOME
let padWidth=100
if [ -n "$1" ]; then
let padWidth=${1}
fi
splitData=( $(awk -f ~/development/shellScripts/hawc.awk project/hawc/urls.py) )
prefix=""
nextFile=""
for sd in "${splitData[@]}"
do
if [ "${prefix}" == "" ]; then
prefix=$sd
else
nextFile="project/$sd"
nextFile=`echo $nextFile | sed 's/\./\//'`
nextFile=`echo $nextFile | sed 's/$/.py/'`
if [ -f $nextFile ]; then
# echo "WORK ON [$prefix], [$nextFile]"
awk -v PAD_WIDTH=${padWidth} -v URL_PREFIX=${prefix} -f /Users/tfeiler/development/shellScripts/hawcEndpointHelper.awk "$nextFile"
exit 1
fi
prefix=""
fi
done
exit 1
cd $HAWC_HOME
let padWidth=100
if [ -n "$1" ]; then
let padWidth=${1}
fi
urlFiles=( $(find . -name "urls.py") )
# loop through the files and hand them off to the helper awk script
for uf in "${urlFiles[@]}"
do
# last element has an extra char on it...
fixedFilename=`echo $uf | sed 's/\.py.*$/.py/'`
awk -v PAD_WIDTH=${padWidth} -f ~/development/shellScripts/hawcEndpointHelper.awk "$fixedFilename"
done
echo "I NEED TO CHECK hawc/urls.py and add prefixes to these..."
echo "I want to rewrite things like (?P<pk>\d+) as {pk}..."
echo "I need to account for the order these urls are defined (maybe)..."