赞一个,有过类似的想法,不过没有去做。
顺便分享一下一个 userscript ,点 github 的复制链接,复制成一个本地 clone 命令,再自己粘贴执行
如:cd ~/github-repos; git clone
https://github.com/facebook/react.git react@facebook; code react@facebook
```js
window.addEventListener('click', (e)=>{
let clip;
if (clip = e.target.closest(`input[value^="
https://github.com/"][value$=".git"] + div > clipboard-copy`)) {
const url = clip.value;
const [_, group, repo] = url.match(/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_-]+)\.git/)
const v = `cd ~/github-repos; git clone ${url} ${repo}@${group}; code ${repo}@${group}`
clip.value = v
document.querySelector('input[value^="
https://github.com/"][value$=".git"]').value = v
}
}, {capture: true})
```