Setting Up a Git Pre-Commit Hook to Parse KRL
Automatically parsing your KRL before committing will save you a lot of frustration.
For more information see Programming Workflow.
Step-by-step guide
Here's what you need to do:
Install the KRL Compiler using this command:
npm install -g krl-compilerensure that its version is at or beyond krl-compiler@1.0.1
if you have an older version, use this command:
npm update -g krl-compiler
Create your git repository
Navigate to <repository>/.git/hooks
Install the
pre-commitshell script from the Programming Tools GitHub repository by placing it in that directory; be sure it's executable
Now, when you commit KRL files, they will be parsed and the commit will fail if they do not parse successfully.