master > master: script zur einfachen Ausführung hinzugefügt
This commit is contained in:
		
							parent
							
								
									57070f4df1
								
							
						
					
					
						commit
						900befbb4e
					
				
							
								
								
									
										3
									
								
								code/.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								code/.gitignore
									
									
									
									
										vendored
									
									
								
							@ -1,3 +1,6 @@
 | 
			
		||||
*
 | 
			
		||||
!/.gitignore
 | 
			
		||||
!/*.py
 | 
			
		||||
 | 
			
		||||
!/run.sh
 | 
			
		||||
!/requirements
 | 
			
		||||
 | 
			
		||||
@ -9,14 +9,9 @@ from __future__ import annotations;
 | 
			
		||||
import os;
 | 
			
		||||
import sys;
 | 
			
		||||
sys.tracebacklimit = 0;
 | 
			
		||||
from itertools import product;
 | 
			
		||||
from lark import Tree;
 | 
			
		||||
from textwrap import dedent;
 | 
			
		||||
from typing import Dict;
 | 
			
		||||
from typing import Generator;
 | 
			
		||||
from typing import List;
 | 
			
		||||
from typing import Tuple;
 | 
			
		||||
from typing import Union;
 | 
			
		||||
 | 
			
		||||
sys.path.insert(0, os.getcwd());
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								code/requirements
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								code/requirements
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
lark
 | 
			
		||||
lark-parser
 | 
			
		||||
lark-parser[regex]
 | 
			
		||||
typing
 | 
			
		||||
							
								
								
									
										23
									
								
								code/run.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										23
									
								
								code/run.sh
									
									
									
									
									
										Executable file
									
								
							@ -0,0 +1,23 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
################################################################################################
 | 
			
		||||
# NOTE: `chmod +x *.sh` vorher ausführen, um dieses Skript benutzen zu können.
 | 
			
		||||
################################################################################################
 | 
			
		||||
 | 
			
		||||
function run_python() {
 | 
			
		||||
    [ "$OSTYPE" == "msys" ] && py -3 $@ || python3 $@;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function run_pip() {
 | 
			
		||||
    run_python -m pip $@;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function run_check_requirements() {
 | 
			
		||||
    run_pip install "$( cat requirements )" >> /dev/null;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
# Kann auskommentiert werden, wenn nötige Module schon installiert:
 | 
			
		||||
run_check_requirements;
 | 
			
		||||
 | 
			
		||||
# Code ausführen:
 | 
			
		||||
run_python main.py;
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user