-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmkpyproj.sh
executable file
·43 lines (38 loc) · 1.01 KB
/
mkpyproj.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
#!/bin/bash
set -x
_PYTHON_VERSION=3.10
SOURCE_GH_REPO="daxxog/envsubst-mustache"
AT_COMMIT="caaf2b3ee50e7e1d64a6dfca0b3ef44473c24437"
PULL_FROM="https://raw.githubusercontent.com/${SOURCE_GH_REPO}/${AT_COMMIT}"
try_pull_remote() {
if [ ! -f ${1} ]; then
wget "${PULL_FROM}/${1}"
else
echo "file '${1}' already exists !"
exit 1
fi
}
latest_python_minor_version() {
curl -sL https://raw.githubusercontent.com/docker-library/python/master/${1}/bullseye/Dockerfile | grep PYTHON_VERSION | head -n 1 | sed 's/ENV PYTHON_VERSION//g; s/ //g' | tr -d '\n' | cat
}
printf "pulling template -->\n\n" && \
try_pull_remote "env.sh" && \
try_pull_remote ".gitignore" && \
touch requirements.txt && \
echo "template pulled !!"
if [ ! -f requirements.dev.txt ]; then
cat <<DEVREQS | tee requirements.dev.txt
neovim
jedi
pynvim
pudb
black
isort
flake8
bandit
-r requirements.txt
DEVREQS
fi
if [ ! -f .python-version ]; then
latest_python_minor_version ${_PYTHON_VERSION} | tee .python-version
fi