bash lang added

This commit is contained in:
Egor Matveev 2022-05-12 09:57:37 +03:00
parent 80c819209c
commit 08de8a05f8
3 changed files with 30 additions and 0 deletions

View File

@ -70,4 +70,13 @@ languages = [
image="swift", image="swift",
highlight="swift", highlight="swift",
), ),
Language(
id=6,
name="Bash",
work_name="Bash",
file_type="sh",
logo_url="https://upload.wikimedia.org/wikipedia/commons/thumb/4/4b/Bash_Logo_Colored.svg/1200px-Bash_Logo_Colored.svg.png",
image="gcc",
highlight="sh",
)
] ]

View File

@ -0,0 +1,20 @@
from os import listdir
from SprintLib.testers.BaseTester import BaseTester, TestException
class BashTester(BaseTester):
file = None
def before_test(self):
for file in listdir(self.path):
if file == 'solution.sh':
self.call(f"chmod 777 {file}")
self.file = file
break
if self.file is None:
raise TestException("TE")
@property
def command(self):
return f"./{self.file}"

View File

@ -7,3 +7,4 @@ from .CSharpTester import CSharpTester
from .KotlinTester import KotlinTester from .KotlinTester import KotlinTester
from .SwiftTester import SwiftTester from .SwiftTester import SwiftTester
from .DistantTester import DistantTester from .DistantTester import DistantTester
from .BashTester import BashTester