forked from newrelic/newrelic-lambda-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gen_third_party.sh
executable file
·52 lines (36 loc) · 1.17 KB
/
gen_third_party.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
51
52
#!/bin/sh
PROJECT=$(basename $PWD)
function getdeps {
REQSFILE=$1; shift
(
TMPINSTALL=`mktemp -d /tmp/${PROJECT}-getdeps.XXXXXX` || exit 1
(
# Record install deps
if [ ! -d $TMPINSTALL/pyenv ]; then
virtualenv $TMPINSTALL/pyenv
fi
) 2>&1 >/dev/null
# Activate pyenv
. $TMPINSTALL/pyenv/bin/activate
# Isolate output from installations
(
pip install pip-licenses;
pip install -r $REQSFILE
) 2>&1 >/dev/null
# Generate markdown report
pip-licenses --format=markdown
)
}
cat <<EOF > THIRD_PARTY_NOTICES.md
# Third Party Notices
The $PROJECT uses source code from third party libraries which carry their own copyright notices and license terms. These notices are provided below.
the event that a required notice is missing or incorrect, please notify us by e-mailing [email protected].
r any licenses that require the disclosure of source code, the source code can be found at https://github.com/newrelic/$PROJECT.
# Content
**[dependencies](#dependencies)**
**[devDependencies](#devdependencies)**
# Dependencies
$(getdeps requirements.txt)
# DevDependencies
$(getdeps dev-requirements.txt)
EOF