瀏覽代碼

install_extras: add macos support

raylu 2 年之前
父節點
當前提交
e742923c01
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      install_extras.py

+ 5 - 0
install_extras.py

@@ -14,6 +14,11 @@ def main():
 	delta()
 	delta()
 
 
 def delta():
 def delta():
+	if platform.system() == 'Darwin':
+		print('$ brew install git-delta')
+		subprocess.run(['brew', 'install', 'git-delta'], check=True)
+		return
+
 	client = httpx.Client()
 	client = httpx.Client()
 	r = client.get('https://api.github.com/repos/dandavison/delta/releases/latest',
 	r = client.get('https://api.github.com/repos/dandavison/delta/releases/latest',
 			headers={'Accept': 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28'})
 			headers={'Accept': 'application/vnd.github+json', 'X-GitHub-Api-Version': '2022-11-28'})