How to correctly work on a GreaseMonkey userscript using git?

好久不见. 提交于 2019-11-30 09:26:52

You could link the necessary files!

Windows (Elevated Command Prompt): mklink <<gmfile>> <<gitfile>>

Unix/Linux: ln -s <<gitfile>> <<gmfile>

Thank you to Enkidu from the Greasespot discussion group for his response!


Using Windows and a .bat file, this code is used to link all the files from you git folder to the Greasemonkey one (it may have errors if there are spaces in the paths or if two of your files have the same name).

echo off

set git_dir=C:\path\to\your\git\folder
set gm_dir=C:\path\to\your\greasemonkey\userscript\folder\

for /R %git_dir% %%G IN (*) do (
    echo Y | del %gm_dir%%%~nxG
    mklink %gm_dir%%%~nxG  %%G
)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!