Как я могу получить функцию «Клон в Mac» для GitHub Gists?

806
abernier

У Github есть кнопка «Клонировать в Mac» для репозиториев:

Кто-нибудь знает какой-нибудь букмарклет или расширение Chrome, чтобы можно было сделать то же самое для гистов?

1

2 ответа на вопрос

1
slhck

The URL of the button is:

github-mac://openRepo/https://github.com/user/repo 

Since Gists are repositories too, the URL for Gists would be:

github-mac://openRepo/https://gist.github.com/123456 

Thus, your Javascript code is:

window.location = "github-mac://openRepo/" + document.location.href 

And your bookmarklet code:

javascript:(function())(); 

To create this bookmarklet, simply go to Bookmarks Manager (or ⌥⌘B), and add your link:

This will now work for all Git repositories, even the normal ones.

Посмотрите мой ответ, я сделал для этого скрипт пользователя с вашими инструкциями. Работает как шарм. Я подтвердил ваш ответ. abernier 11 лет назад 0
1
abernier

I made a userscript to automatically add 'Clone in Mac' button on gists.

enter image description here

https://gist.github.com/3227047

And of course, you can clone it in Mac :p