Merge branch '19-bash-prepare-script' into 'master'
Resolve "Bash script to prepare the system for the first use of the python based cli" Closes #19 See merge request icaotix/linux-tools!14
This commit is contained in:
commit
4c81e9d66b
5
modules/helloworld/__init__.py
Normal file
5
modules/helloworld/__init__.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
from .helloWorld import HelloWorld
|
||||||
|
|
||||||
|
|
||||||
|
def get_module():
|
||||||
|
return HelloWorld()
|
12
modules/helloworld/helloWorld.py
Normal file
12
modules/helloworld/helloWorld.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from AbstractModule import AbstractModule
|
||||||
|
|
||||||
|
|
||||||
|
class HelloWorld(AbstractModule):
|
||||||
|
"""docstring for SampleModule."""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
super(HelloWorld, self).__init__()
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
print("This shows that your installation is working correctly.")
|
||||||
|
print("You can now start using the tool.")
|
@ -1,5 +0,0 @@
|
|||||||
from .sampleModule import SampleModule
|
|
||||||
|
|
||||||
|
|
||||||
def get_module():
|
|
||||||
return SampleModule()
|
|
@ -1,12 +0,0 @@
|
|||||||
from AbstractModule import AbstractModule
|
|
||||||
|
|
||||||
|
|
||||||
class SampleModule(AbstractModule):
|
|
||||||
"""docstring for SampleModule."""
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
super(SampleModule, self).__init__()
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
print("Command 1")
|
|
||||||
print("Command 2")
|
|
13
start.sh
Normal file → Executable file
13
start.sh
Normal file → Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ "$1" == "prepare" ]
|
||||||
|
then
|
||||||
|
echo "Preparing your system for the first run"
|
||||||
|
apt update -y && apt upgrade -y
|
||||||
|
apt install python3.7 python3-pip -y
|
||||||
|
pip3 install setuptools wheel regex
|
||||||
|
pip3 install -r requirements.txt
|
||||||
|
python3 main.py helloworld run
|
||||||
|
else
|
||||||
|
python3 main.py "$@"
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user