提交 b5ac9139 编写于 作者: P prgrmz01@163.com

dev

上级 fda8a733
__pycache__/
.idea/
......@@ -6,4 +6,5 @@ new_args=python replace_url "$*"
# new_args : -c advice.detachedHead=false clone --depth 1 --branch main git@gitcode.net/dependency/frida/glib.git glib
/usr/bin/git.original $new_args
#/usr/bin/git.original $new_args
originalGitFullPath $new_args
#!/bin/sh
which git || (echo no git ; exit 1)
_gitFullPath=`which git`
sudo mv `which git` `which git`.original
sed 's/originalGitFullPath/`which git`.original/g' -i ./git
mv ./git $_gitFullPath
\ No newline at end of file
import sys
from typing import List
"""
# $* : -c advice.detachedHead=false clone --depth 1 --branch main https://github.com/frida/glib.git glib
# new_args : -c advice.detachedHead=false clone --depth 1 --branch main git@gitcode.net/dependency/frida/glib.git glib
"""
"""
['D:\\pubx\\git-replace\\replace_url.py', '-c', 'advice.detachedHead=false', 'clone', '--depth', '1', '--branch', 'main', 'https://github.com/frida/glib.git', 'glib']
"""
from repo_map import repo_url_map
def processWordK(wordK:str)->str:
if wordK.startswith("https://github.com"):
if repo_url_map.__contains__(wordK):
return repo_url_map.__getitem__(wordK)
else:
return wordK
else:
return wordK
new_list:List[str]=list(map(lambda wordK:processWordK(wordK), sys.argv[1:]))
new_arg:str=" ".join(new_list)
print(new_arg)
from typing import Dict
repo_url_map:Dict[str,str]={
"https://github.com/abseil/abseil-cpp.git":"git@gitcode.net:dependency/abseil/abseil-cpp.git",
"https://github.com/frida/glib.git":"git@gitcode.net:fridaz/frida.git",
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册