load #pepper
Pepper is a lua PrEPRocssing script that can help create different builds from the same code.
Source is under the MIT license at https://github.com/Werxzy/pepper.p64
Pepper works by looking through all the lua files in a loaded project and searches for specific labels, which can then be used to remove or add code before running or exporting. It takes 3 different forms: 1. A tool in the tooltray from which you can select an initial .pepper config file. 2. A window that can be run without installing. 3. A terminal command. After installing, you can type pepper into the terminal to get more info.
Upon installing:
- Pepper will be copied to /appdata/system/tooltray/
- Startup.lua will be created OR appended to at /appdata/system/ to have pepper open on boot up
- Startup.lua will also get a copy command to put pepper into /system/util/ for use in the terminal or other projects
Uninstalling will remove all of these. (for startup.lua, only the relevant lines will be removed.)
Pepper is useful for creating builds for debugging, full vs demo, or any other case that requires creating different versions. For me, I'm primarily made this for creating an empty example project for Picotron Solitaire Suite.
-- Example code --#def debug true -- leave the default path uncommented --#if not debug print("debug mode disabled") --[[#else print("debug mode enabled") --#end]] -- values are actually run as lua code in a fresh env. --#def val debug and 1 or 2 -- similar to "val = debug and 1 or 2" --#if val > 1 --[[#elseif val == 0 --#else --#end]] -- A .pepper file can also be created to state initial parameters |
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/80204/robot.png)
Updated pepper to run the current project within the terminal in the same way ctrl+r does.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/80204/robot.png)
Updated to version 1.1 as there was a bug where lua files in subdirectories were being ignored for preprocessing.
[Please log in to post a comment]