-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewfunc
More file actions
executable file
·36 lines (26 loc) · 776 Bytes
/
newfunc
File metadata and controls
executable file
·36 lines (26 loc) · 776 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
35
#!/bin/bash
# Creates a new Azure Function configuration in application/functionname
# using Azure Functions Core Tool
# eg. $ ./newapp opssys/burnaddress
AZ_FUNCTION_DIR=az-functions
if [ "${1}x" = "x" ]; then
echo Usage: $0 \<appname\>/\<functionname\>
exit
fi
APPLICATION=$(dirname $1)
FUNCTION=$(basename $1)
FUNCTION_DIR=$APPLICATION/$AZ_FUNCTION_DIR/$FUNCTION
if [ $APPLICATION = "." ]; then
echo Usage: $0 \<appname\>/\<functionname\>
exit
fi
if [ ! -e $APPLICATION ]; then
echo Application $APPLICATION doesn\'t exist
exit
fi
if [ -e $FUNCTION_DIR ]; then
echo Function directory $FUNCTION_DIR already exists
exit
fi
cd $APPLICATION/$AZ_FUNCTION_DIR || exit
func new --language custom -t httptrigger -n $FUNCTION -a anonymous