Created
July 24, 2019 14:38
-
-
Save DrOreo002/44bbc845d572dc87aea5cd145b39b764 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from colorama import init | |
from colorama import Fore, Back, Style | |
from os import listdir | |
init() | |
SUB_PRINT = " > " | |
jarsFile = listdir("Jars") | |
index = 0 | |
print(Fore.GREEN + " [Maven Local Dependency Installer v1.0]") | |
print(Fore.WHITE + " Made with love by DrOreo002") | |
print(Fore.WHITE + "> Loading jars") | |
for file in jarsFile: | |
print(Fore.WHITE + " > Loaded: " + Fore.LIGHTGREEN_EX + file + Fore.BLUE + " [" + str(index) + "]") | |
index += 1 | |
print(Fore.WHITE + "> Please select your dependency " + Fore.GREEN + "(Integer only)" + Fore.WHITE + ":") | |
selectedIndex = int(input(SUB_PRINT)) | |
selectedFile = jarsFile[selectedIndex] | |
print("> Please type your dependency " + Fore.GREEN + "groupId" + Fore.WHITE + ":") | |
groupId = str(input(SUB_PRINT)) | |
print("> Please type your dependency " + Fore.GREEN + "artifactId" + Fore.WHITE + ":") | |
artifactId = str(input(SUB_PRINT)) | |
print("> Please type your dependency " + Fore.GREEN + "version" + Fore.WHITE + ":") | |
version = str(input(SUB_PRINT)) | |
# Print verification | |
print(Fore.GREEN + " [Verification]") | |
print(Fore.WHITE + " Is this correct? " + Fore.BLUE + "[Y/N]") | |
print(Fore.WHITE + "> File name: " + Fore.GREEN + selectedFile) | |
print(Fore.WHITE + "> Group Id: " + Fore.GREEN + groupId) | |
print(Fore.WHITE + "> Artifact Id: " + Fore.GREEN + artifactId) | |
print(Fore.WHITE + "> Version: " + Fore.GREEN + version) | |
print(Fore.WHITE) # Clear the colors | |
typed = input() | |
if not typed.lower() == "y": | |
print("> Okay then.... " + Fore.RED + "[Closing Program]") | |
exit(0) | |
pass | |
os.chdir("Jars") | |
os.system("mvn install:install-file -Dfile=" + selectedFile + " -DgroupId=" + groupId + " -DartifactId=" + artifactId + " -Dversion=" + version + " -Dpackaging=jar") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment