You can put any of the file types listed above in a directory that is in your $FIGPATH. To render or execute these files, you can simply run
fig file_name(without the extension).
fig file_name # do not pass the extension
- 1.$FIGPATH Match Hierarchy shows how Fig delineates between files with the same name but different extensions
- 2.Example gives an example directory of files and shows how Fig would parse some example commands
Let's say you ran
fig CMDin your Terminal.
Fig will loop through each path in your $FIGPATH. It will check if there is a specific file in that path that matches the passed command,
CMD. Fig checks for matches in the specific order below:
- Note: This is a folder called "CMD" that contains an index.html file
- This is a file called "CMD" with no extension
Fig will open that file according to its format
Render the html using:
Follow the CLI schema in your
.sh, .py, .js, (or files with no extension)
Run the file as an executable:
Note: After a command has been matched, all remaining subcommands, parameters, or other inputs (e.g.
fig CMD sub1 sub2 --flag abc) will be passed in to Fig's response.
Fig will run this same process in next path specified in your the $FIGPATH
Here is an example list of files in a directory that I have added to my $FIGPATH
Here are some example commands I could run in my Terminal:
- This will select the ACME.fig file and follow the CLI commands and subcommands defined in the .fig file.
- This would NOT match ACME.sh as .fig ranks higher than .sh
- This will render the deploy/index.html file in a Fig window
- This would NOT match the test/index.js file. Fig only matches folders when they contain an index.html file.
- Fig would continue to the next path in the $FIGPATH
- This would match calendar.js
- This would NOT match CALENDAR.py (even though .py ranks higher than .js) as commands are case sensitive
fig calendar new meeting at 2pm this thursday
- This would match calendar.js (as above) and would pass
new meeting at 2pm this sundayas an input to the executable
- This would render the forkDB.run interactive runbooks in a Fig window