|
16 | 16 | try:
|
17 | 17 | import requests
|
18 | 18 | except:
|
| 19 | + print('Attempting to install the requirements...') |
19 | 20 |
|
20 | 21 | try:
|
21 | 22 | for module in modules:
|
22 |
| - subprocess.run(['python', '-m', 'pip', 'install', module]) |
| 23 | + subprocess.run(['python', '-m', 'pip', 'install', module], |
| 24 | + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
23 | 25 | import requests
|
| 26 | + print('Requirements was successful installed!') |
24 | 27 | except:
|
25 |
| - pass |
26 |
| - |
27 |
| - try: |
28 |
| - for module in modules: |
29 |
| - subprocess.run(['python3', '-m', 'pip', 'install', module]) |
30 |
| - import requests |
31 |
| - except: |
32 |
| - sys.exit('Could not install requirements') |
| 28 | + try: |
| 29 | + for module in modules: |
| 30 | + subprocess.run(['python3', '-m', 'pip', 'install', module], |
| 31 | + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) |
| 32 | + import requests |
| 33 | + print('Requirements was successful installed!') |
| 34 | + except: |
| 35 | + sys.exit('Could not install requirements :(') |
33 | 36 |
|
34 | 37 |
|
35 | 38 | ### Comandline arguments ###
|
@@ -98,7 +101,8 @@ def check_url(url):
|
98 | 101 | sys.exit("Someone closed the program")
|
99 | 102 | else:
|
100 | 103 | if r.status_code == 404:
|
101 |
| - sys.exit("404: Verify internet connection or check if the url is correct") |
| 104 | + sys.exit( |
| 105 | + "404: Verify internet connection or check if the url is correct") |
102 | 106 |
|
103 | 107 | if not "https://github.com/" in url:
|
104 | 108 | sys.exit("Not a Github repo")
|
|
0 commit comments