-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·46 lines (39 loc) · 1023 Bytes
/
install.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1023 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
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -e
ver=`/usr/bin/env python -c "from __future__ import print_function;import sys;print(sys.version[0])"`
if [ $? -ne 0 ];then
echo "Could find any python installation."
exit 1
fi
pyexe=`which python`
if [ $ver -ne 3 ]; then
which python3 1>/dev/null 2>&1
if [ $? -ne 0 ];then
echo "Could find any python3 installation."
exit 1
fi
pyexe=`which python3`
fi
import_path=`$pyexe -c "import sys;print(sys.path[-1] + '/private')"`
# copy the private.py as module
if [ -d $import_path ]; then
echo ""
fi
if [ ! -d $import_path ]; then
mkdir $import_path
fi
if [ $? -ne 0 ];then
echo "Unable to copy files to "$import_path\
". Try running the script as sudo e.g. > sudo ./install.sh"
exit 1
fi
import_path=$import_path"/"
cp -f __init__.py $import_path
if [ $? -ne 0 ];then
echo "Unable to copy files to "$import_path\
". Try running the script as sudo e.g. > sudo ./install.sh"
exit 1
fi
echo "Files copied to "$import_path":"
echo " __init__.py"
echo "Installation done!."