-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (27 loc) · 1.08 KB
/
main.py
File metadata and controls
36 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 这是一个示例 Python 脚本。
# 按 Ctrl+F5 执行或将其替换为您的代码。
# 按 双击 Shift 在所有地方搜索类、文件、工具窗口、操作和设置。
import os
def print_hi(name):
# 在下面的代码行中使用断点来调试脚本。
print(f'Hi, {name}') # 按 F9 切换断点。
# 按间距中的绿色按钮以运行脚本。
if __name__ == '__main__':
print_hi('PyCharm')
with open("repos.txt") as file:
lines = file.readlines()
for line in lines:
# print(line)
line = line.strip()
# gitAddress = 'https://github.com/massiveflow/toml-nodejs.git'
gitAddress = line
gitPath = './'
gitNameEnd = len(gitAddress)
if gitAddress.endswith('.git'):
gitNameEnd = gitAddress.find('.git')
gitNameBegin = gitAddress.rfind('/')
gitName = gitAddress[gitNameBegin:gitNameEnd]
# print(gitName)
cmdStr = 'git clone --progress -v ' + gitAddress + ' .' + gitName
print(cmdStr)
os.system(cmdStr)