github - How to correctly work on a GreaseMonkey userscript using git? -
i working on userscript firefox, use greasemonkey. moreover, facilitate development, use git update different versions of code.
now, let me try explain issue.
when add greasemonkey userscript local git directory, new files created in gm_scripts folder of firefox profile.
greasemonkey use these files source , not git directory, if want modify code , test stuff, have change files inside gm_scripts. means can not commit modification, first have copy files gm_scripts git directory. unconvenient.
there solution. can modify script git directory, , re-install greasemonkey using bookmark pointing these local files. once again, not handy @ all.
what thought third define folder inside gm_scripts git directory. unfortunatly, project contains many files ordered folders, , want keep clean. adding userscript greasemonkey makes files extract folder.
moreover, git project not contains userscript folder, there other stuff. not idea declare gm_script's directory source git, putting many files in gm_scripts whereas had nothing userscript not method. , not right forced have work in folder lost in depths of firefox profile.
i know if there technique work efficiently , on project including both greasemonkey , git.
you link necessary files!
windows (elevated command prompt):
mklink <<gmfile>> <<gitfile>>
unix/linux:
ln -s <<gitfile>> <<gmfile>
thank enkidu greasespot discussion group response!
using windows , .bat
file, code used link files git folder greasemonkey 1 (it may have errors if there spaces in paths or if 2 of files have same name).
echo off set git_dir=c:\path\to\your\git\folder set gm_dir=c:\path\to\your\greasemonkey\userscript\folder\ /r %git_dir% %%g in (*) ( echo y | del %gm_dir%%%~nxg mklink %gm_dir%%%~nxg %%g )
Comments
Post a Comment