...
Create a directory for your project
Code Block language bash $ mkdir workflow $ cd workflow/
Initialize the project directory as a Git repository
Code Block language bash $ git init
Follow the directions in Setting Up a Git Pre-Commit Hook to Parse KRL to set up the KRL parser and ensure that KRL files are parsed before they are committed.
- Create a KRL ruleset as a file in the repository using your favorite editor. There may be a KRL plugin for your editor.
Add the file to the repository and commit it.
Code Block language bash $ git add hello_world.krl $ git commit -a -m "initial commit" Flushing com.windley.hello_world [master (root-commit) 4a2f95c] initial commit 1 file changed, 34 insertions(+) create mode 100644 hello_world.krl
With the pre-commit hook in place, you're assured that there are no parse errors in your ruleset if it commits.
Also, the pre-commit hook flushes rulesets in a local engine.
- install the ruleset in your pico by navigating to the Rulesets page in the pico engine interface and putting it's full URL in the box labeled "Install ruleset from URL:" and clicking the button. We are using the file: URL scheme to load the ruleset from the filesystem directly into the engine rather than relying on an external server. The file URL is the schema file:// prepended to the full pathname of the file (yes, there are three slashes):
file:///Users/pjw/prog/picolabs/pico_lessons/workflow/hello_world.krl
You'll now see the ruleset listed in the installed rulesets in the pico. If you click on the "Engine Rulesets" link, you'll navigate to a page that shows the rulesets registered with the engine.
...