Update index.py

This commit is contained in:
Mr Chen
2024-11-28 23:28:58 +08:00
parent c71a59cce1
commit 58cb061ef2
+3 -6
View File
@@ -103,8 +103,7 @@ def getHomeDir():
def getRunUser(): def getRunUser():
if mw.isAppleSystem(): if mw.isAppleSystem():
user = mw.execShell( user = mw.execShell("who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
return user return user
else: else:
return 'root' return 'root'
@@ -566,8 +565,7 @@ def repoList():
# print(list_data) # print(list_data)
list_data = checkRepoListIsHasScript(list_data) list_data = checkRepoListIsHasScript(list_data)
data['list'] = mw.getPage({'count': count, 'p': page, data['list'] = mw.getPage({'count': count, 'p': page, 'row': page_size, 'tojs': 'gogsRepoListPage'})
'row': page_size, 'tojs': 'gogsRepoListPage'})
data['page'] = page data['page'] = page
data['page_size'] = page_size data['page_size'] = page_size
data['page_count'] = int(math.ceil(count / page_size)) data['page_count'] = int(math.ceil(count / page_size))
@@ -826,8 +824,7 @@ def projectScriptSelf_Create():
name = args['name'] + '.git' name = args['name'] + '.git'
file = args['file'] file = args['file']
self_path = path = getRootPath() + '/' + user + '/' + \ self_path = path = getRootPath() + '/' + user + '/' + name + '/custom_hooks/self'
name + '/custom_hooks/self'
if not os.path.exists(self_path): if not os.path.exists(self_path):
os.mkdir(self_path) os.mkdir(self_path)