initial commit
This commit is contained in:
		
							
								
								
									
										29
									
								
								main.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								main.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | ||||
| #!/usr/bin/bash | ||||
|  | ||||
| ## Changing to the directory housing this file | ||||
| cd "${1/*\/}" | ||||
|  | ||||
| ## Including core libs | ||||
| [[ -f utils/includes.sh ]] && . utils/includes.sh | ||||
|  | ||||
| include utils/prompts | ||||
|  | ||||
| # BEGIN: Variables | ||||
|  | ||||
| ## Config file | ||||
| CONFIG=~/.config/dnd-tools.conf | ||||
|  | ||||
| declare -A dice( | ||||
| 	d2 | ||||
| 	d4 | ||||
| 	d6 | ||||
| 	d8 | ||||
| 	d10 | ||||
| 	d12 | ||||
| 	d20 | ||||
| 	d100 | ||||
| 	custom | ||||
| ) | ||||
|  | ||||
| # END: Variables | ||||
|  | ||||
							
								
								
									
										14
									
								
								utils/includes.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								utils/includes.sh
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| #!/usr/bin/bash | ||||
|  | ||||
| function include () { | ||||
| 	SHELL_SCRIPT_REGEX='\S+\.sh' | ||||
| 	local INCLUDE_FILE="${1:?"include : File not provided"}" | ||||
| 	local FILENAME="${INCLUDE_FILE/*\/}" | ||||
|  | ||||
| 	if [[ -f "$FILENAME" ]]; then | ||||
| 		. $FILENAME | ||||
| 	else if	[[ -f "$FILENAME.sh" ]]; then | ||||
| 		. $FILENAME.sh | ||||
| 	     fi | ||||
| 	fi | ||||
| } | ||||
		Reference in New Issue
	
	Block a user