<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cody Tilkins</title>
    <description>The latest articles on DEV Community by Cody Tilkins (@tilkinsc).</description>
    <link>https://dev.to/tilkinsc</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F587641%2Fd09f1256-a4fe-4040-8141-0fd155a6c460.jpeg</url>
      <title>DEV Community: Cody Tilkins</title>
      <link>https://dev.to/tilkinsc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tilkinsc"/>
    <language>en</language>
    <item>
      <title>Why you should care about your git repository structure and file names</title>
      <dc:creator>Cody Tilkins</dc:creator>
      <pubDate>Sun, 28 Feb 2021 22:43:48 +0000</pubDate>
      <link>https://dev.to/tilkinsc/why-you-should-care-about-your-git-repository-structure-and-file-names-48an</link>
      <guid>https://dev.to/tilkinsc/why-you-should-care-about-your-git-repository-structure-and-file-names-48an</guid>
      <description>&lt;p&gt;In modern day, a majority of programmers have adopted git, npm, apt, snap, and whatever have you. There are some of us who care about the structure of repositories, and some who just stick a few hundred files in a directory, slap on cmake/make/.package/etc and call it good.&lt;/p&gt;

&lt;p&gt;This topic is fairly obvious. Have you ever entered a massive repository with the aspiration to contribute, but couldn't find a single thing? Have you ever had to rely on git frontends search engines? Have you ever had to delve into issues/PRs because you couldn't find where a certain file was located? Have you ever walked away from a project with an 'ummm' because you broke your scroll wheel? Have you ever not been able to implement cmake in a relatively easy way due the sheer amount of files spread everywhere?&lt;/p&gt;

&lt;p&gt;When you have a public non-read-only repository, it is guaranteed to grow. That is the beauty of open source and you should embrace free software. What can organization bring to you?&lt;/p&gt;

&lt;h1&gt;
  
  
  Subdirectories
&lt;/h1&gt;

&lt;p&gt;If you use cmake or make, you are probably familiar with the appeal of having one subdirectory per target in a solution and shared in a separate subdirectory, built as a separate target.&lt;/p&gt;

&lt;p&gt;Programs like cmake or make don't offer much support in the way of build trees and working directory support. This is a pity really, but as a developer I guarantee you've been to hell and back implementing cmake and make build files on top of your build tree. A developer's pipe dream is just to shove &lt;code&gt;*.source&lt;/code&gt; into a single binary and it just pops out something usable. CMake is the worst of the two due to having next to zero implementation documentation - something you have to pick up from studying actual scripts.&lt;/p&gt;

&lt;p&gt;Shortly said, you will likely want to eventually implement make or cmake so you should keep each target separate in a solution so that you can accurately reference shared reliably while having zero possibility to link or use files from other targets. Imagine the upkeep the &lt;a href="https://github.com/lua/lua"&gt;Lua&lt;/a&gt; team has to go through. If you check out their makefile, you will note they have about 5 solutions [lua.exe, luac.exe, auxlib, lualib, lua.dll] built out of the root of the project. They use &lt;code&gt;gcc -MM...&lt;/code&gt; to generate their tree and manually amend it to the makefile. Wouldn't it be nice to... you know... &lt;code&gt;gcc -o lua.exe *.c -l...&lt;/code&gt;?&lt;/p&gt;

&lt;h1&gt;
  
  
  Entry Points
&lt;/h1&gt;

&lt;p&gt;Clicking through a new repository, your first instinct probably is 'where is the main'. This goes hand and hand with two different, but similar points. File and Folder naming.&lt;/p&gt;

&lt;p&gt;I'm sure you all want to stick your files in a folder called foo and call all your files bar-n.source, but did you know this is malpractice and a sin? Commit (get it) blasphemy no more!&lt;/p&gt;

&lt;p&gt;You should conform with your language's file naming conventions when it comes to entry points. If you don't, users may end up including the wrong file, assuming your project is broken, and at worst &lt;code&gt;npm uninstall your_repo&lt;/code&gt;. This is most notable in c, c++, javascript and python. It could be extended to many other languages. Please don't hide your entry point.&lt;/p&gt;

&lt;p&gt;Leave a comment below with which folder you think holds the entry point to this program.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36c0n2f1wxokp6bjohkm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36c0n2f1wxokp6bjohkm.png" alt="alt text" width="231" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
    </item>
    <item>
      <title>How to build, use, and execute Lua code and files from LuaConsole</title>
      <dc:creator>Cody Tilkins</dc:creator>
      <pubDate>Sun, 28 Feb 2021 04:54:43 +0000</pubDate>
      <link>https://dev.to/tilkinsc/how-build-use-and-execute-lua-code-and-files-from-luaconsole-1hko</link>
      <guid>https://dev.to/tilkinsc/how-build-use-and-execute-lua-code-and-files-from-luaconsole-1hko</guid>
      <description>&lt;p&gt;LuaConsole is a powerful command line application (CLI) for Windows, Linux, and Mac which boasts various amounts of usability through switches and convention conformance over the default PUC-Lua and LuaJIT CLI. All the while it supports all major Lua versions (lua-5.1.x to lua-5.4.x) to be executed from a single binary file! It doesn't stop there, however, as it also supports the major package management repositories such as LuaDIST (deprecated) and LuaRocks! It supports MSVS(MSVC), GNU GCC/MingW64, and llvm (with a little set up).&lt;/p&gt;

&lt;h1&gt;
  
  
  Download &amp;amp; Install/Build LuaConsole
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Downloading
&lt;/h2&gt;

&lt;p&gt;LuaConsole can be found at the &lt;a href="https://github.com/tilkinsc/LuaConsole" rel="noopener noreferrer"&gt;Github Repository&lt;/a&gt;. If you are on windows, you can select 'Releases' from the side bar and download a pre-built copy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installing
&lt;/h2&gt;

&lt;p&gt;LuaConsole is a self-contained package for both Linux and Windows.&lt;/p&gt;

&lt;h3&gt;
  
  
  Makefile
&lt;/h3&gt;

&lt;p&gt;The makefile is in place to help developers familiar with the conventions use the scripts inside the repository. If you are unfamiliar with Makefile, follow along to the next &lt;code&gt;Windows&lt;/code&gt; or &lt;code&gt;Linux&lt;/code&gt; sections.&lt;/p&gt;

&lt;p&gt;PLAT: Windows, MSVS, Unix, MacOS, or Linux&lt;br&gt;
LUA_VER: luajit, lua-5.4.2, etc&lt;/p&gt;

&lt;p&gt;Note: Windows uses MinGW64, MSVS uses cl.exe, Linux uses GCC&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;make &lt;span class="nv"&gt;PLAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Linux &lt;span class="nv"&gt;LUA_VER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;luajit driver
make &lt;span class="nv"&gt;PLAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Linux &lt;span class="nv"&gt;LUA_VER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lua-5.4.2 package
make &lt;span class="nv"&gt;PLAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Linux &lt;span class="nv"&gt;LUA_VER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lua-5.3.6 package
make &lt;span class="nv"&gt;PLAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Linux &lt;span class="nv"&gt;LUA_VER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lua-5.2.4 package
make &lt;span class="nv"&gt;PLAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Linux &lt;span class="nv"&gt;LUA_VER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;lua-5.1.5 package
make &lt;span class="nv"&gt;PLAT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Linux &lt;span class="s2"&gt;"PREFIX=./install_dir/"&lt;/span&gt; &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;You will need to migrate the downloaded folder somewhere in your system and set up your environment variables. This is a simple task. LuaConsole is a 64bit application, so it belongs in &lt;code&gt;C:\Program Files&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you are building from source,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight batchfile"&gt;&lt;code&gt;&lt;span class="kd"&gt;git&lt;/span&gt; &lt;span class="kd"&gt;clone&lt;/span&gt; &lt;span class="kd"&gt;https&lt;/span&gt;://www.github.com/tilkinsc/LuaConsole
&lt;span class="nb"&gt;pushd&lt;/span&gt; &lt;span class="kd"&gt;LuaConsole&lt;/span&gt;
&lt;span class="kd"&gt;prereqs&lt;/span&gt;.bat &lt;span class="kd"&gt;download&lt;/span&gt;
&lt;span class="kd"&gt;build&lt;/span&gt;.mingw.bat &lt;span class="kd"&gt;driver&lt;/span&gt; &lt;span class="kd"&gt;luajit&lt;/span&gt;
&lt;span class="kd"&gt;build&lt;/span&gt;.mingw.bat &lt;span class="kd"&gt;package&lt;/span&gt; &lt;span class="kd"&gt;lua&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;.4.2
&lt;span class="kd"&gt;build&lt;/span&gt;.mingw.bat &lt;span class="kd"&gt;package&lt;/span&gt; &lt;span class="kd"&gt;lua&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;.3.6
&lt;span class="kd"&gt;build&lt;/span&gt;.mingw.bat &lt;span class="kd"&gt;package&lt;/span&gt; &lt;span class="kd"&gt;lua&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;.2.4
&lt;span class="kd"&gt;build&lt;/span&gt;.mingw.bat &lt;span class="kd"&gt;package&lt;/span&gt; &lt;span class="kd"&gt;lua&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;.1.5
# &lt;span class="kd"&gt;lua&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;.0.x &lt;span class="kd"&gt;is&lt;/span&gt; &lt;span class="kd"&gt;unsupported&lt;/span&gt; &lt;span class="nb"&gt;at&lt;/span&gt; &lt;span class="kd"&gt;this&lt;/span&gt; &lt;span class="nb"&gt;time&lt;/span&gt;
&lt;span class="nb"&gt;popd&lt;/span&gt;
# &lt;span class="kd"&gt;binaries&lt;/span&gt; &lt;span class="kd"&gt;are&lt;/span&gt; &lt;span class="kd"&gt;built&lt;/span&gt; &lt;span class="kd"&gt;to&lt;/span&gt; &lt;span class="kd"&gt;LuaConsole&lt;/span&gt;&lt;span class="na"&gt;/bin/Release
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvjvcbpmtoqq3e49qv3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvjvcbpmtoqq3e49qv3q.png" alt="Program Files"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I decided to create a folder called 'LuaConsole'. The full path would be, &lt;code&gt;C:\Program Files\LuaConsole&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, you want to set up LuaConsole so that you can just execute the program without specifying the path each time. This is trivial - just edit your environment variables. You can do this through the UI or in a console with &lt;code&gt;setx "path=%path%;C:\Program Files\LuaConsole"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4wfut5y5b3pcz06w2lg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb4wfut5y5b3pcz06w2lg.png" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;p&gt;Building in Linux is very straight forward. Simply download the prerequisites, followed by building the driver with a default lua version, and finally building all the lua versions you will use. Don't worry about it too much, as you can add more lua packages later. I prefer to use the bash scripts. To learn more about the scripts, they listen to &lt;code&gt;--help&lt;/code&gt; or check out the &lt;a href="https://github.com/tilkinsc/LuaConsole/wiki" rel="noopener noreferrer"&gt;LuaConsole Wiki&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://www.github.com/tilkinsc/LuaConsole
&lt;span class="nb"&gt;pushd &lt;/span&gt;LuaConsole
./prereqs.sh download
./build.linux.sh driver luajit
./build.linux.sh package lua-5.4.2
./build.linux.sh package lua-5.3.6
./build.linux.sh package lua-5.2.4
./build.linux.sh package lua-5.1.5
&lt;span class="c"&gt;# lua-5.0.x is unsupported at this time&lt;/span&gt;
&lt;span class="nb"&gt;popd&lt;/span&gt;
&lt;span class="c"&gt;# binaries are build to ./LuaConsole/bin/Release&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;LuaConsole is a self-contained program unless you add the liblua*.so files into a library path or set up a library path for them. liblclua*.so must stay next to the executable, as they are dynamically loaded. You can configure &lt;code&gt;export LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH&lt;/code&gt; for now to test and use it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Executing Lua Files
&lt;/h1&gt;

&lt;p&gt;Simply launch the program from terminal or console!&lt;/p&gt;

&lt;p&gt;Here is a test script in case you came unprepared:&lt;/p&gt;

&lt;p&gt;test_script.lua&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight lua"&gt;&lt;code&gt;&lt;span class="nb"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'hello world!'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is also a test program in &lt;code&gt;LuaConsole/res/testing.lua&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These are various ways to launch a .lua file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw test_script.lua
luaw &lt;span class="nt"&gt;-ltest_script&lt;/span&gt;.lua
luaw &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"dofile('test_script.lua')"&lt;/span&gt;
&lt;span class="nb"&gt;type &lt;/span&gt;test_script.lua | luaw -
&lt;span class="nb"&gt;cat &lt;/span&gt;test_script.lua | luaw -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Extra Features
&lt;/h1&gt;

&lt;p&gt;LuaConsole has many more features than the default PUC-Lua CLI application. The possibilities are endless! Try &lt;code&gt;luaw --help&lt;/code&gt; to learn more! Don't worry too much about how you send arguments in - LuaConsole will accept arguments with &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;-&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Start in REPL mode or analyze the environment after a script.&lt;/em&gt; REPL stands for Read Execute Print Loop. Perhaps you want to test a single line of code. Perhaps you want to procedurally program something. For those familiar with GNU GDB, Lua doesn't really have something to debug an environment. LuaConsole introduced the ability to use REPL mode and for you to command how you use it! This is achieved with the -p switch. This means you can take a look at global variables, their values, and tons more - straight from a REPL!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw
luaw &lt;span class="nt"&gt;-p&lt;/span&gt;
luaw some_file.lua &lt;span class="nt"&gt;-p&lt;/span&gt;
luaw &lt;span class="nt"&gt;-lsome_file&lt;/span&gt;.lua &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Do not print any copyright information.&lt;/em&gt; This is good if you want to use Lua to capture output of the scripts - doing math for example. Use the -c switch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print(1 + 2)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Change Lua versions.&lt;/em&gt; Sometimes scripts are only supported in 5.2.x or 5.3.x and above. This is likely due to the developer wanting to use the bits core library. Simply use the -w switch and specify the version you want to use. For luajit, specify &lt;code&gt;luajit&lt;/code&gt;. For lua-5.3.5, supply &lt;code&gt;lua-5.3.5&lt;/code&gt;. It's that easy!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw &lt;span class="nt"&gt;-w&lt;/span&gt; luajit &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print(1 + 2)"&lt;/span&gt;
luaw &lt;span class="nt"&gt;-w&lt;/span&gt; lua-5.3.5 &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print(1 + 2)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Create a global variable for your script to use.&lt;/em&gt; Sometimes you just want a variable that you can change easily from the CLI. You may want to feed some data into Lua, or you just want a boolean. LuaConsole has your back with the -D switch. Simply use the format, &lt;code&gt;-Dvariable=value&lt;/code&gt;. A bonus: it will correctly type your variable's value and it can even span tables!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw &lt;span class="nt"&gt;-Dexample&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5 &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print(1 + example)"&lt;/span&gt;
luaw &lt;span class="nt"&gt;-Dtab&lt;/span&gt;.var&lt;span class="o"&gt;=&lt;/span&gt;5 &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print(1 + tab.var)"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Supply arguments through the &lt;code&gt;arg&lt;/code&gt; variable or tuple &lt;code&gt;...&lt;/code&gt; notation.&lt;/em&gt; Perhaps you are making a script to be run like a command line application. You would find yourself using the -n switch in LuaConsole. Be aware that you need to use it at the end, or else you will translate switches as arguments!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"for i, v in next, arg do print(i, v) end"&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; a b c d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Change directories.&lt;/em&gt; You just cd'd or pushd'd into a subdirectory to run a script, but you have a lot of relative paths you don't want to change from the root. This is where the -s variable comes in to play. Simply use the format, &lt;code&gt;-s C:\start_dir&lt;/code&gt; and you are on your way!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# ./&lt;/span&gt;
&lt;span class="c"&gt;# some_dir/test.lua&lt;/span&gt;
&lt;span class="c"&gt;# main.lua&lt;/span&gt;
&lt;span class="nb"&gt;pushd &lt;/span&gt;some_dir
luaw &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"dofile('main.lua')"&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; ..
&lt;span class="nb"&gt;popd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Have fun playing around with LuaConsole! A final footnote, there is a difference between &lt;code&gt;-E and -e&lt;/code&gt; and &lt;code&gt;-L and -l&lt;/code&gt;. This is in place to determine which script or piece of code runs when. You can make an abomination like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;luaw helloworld5.lua helloworld6.lua &lt;span class="nt"&gt;-E&lt;/span&gt; &lt;span class="s2"&gt;"print(1)"&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"print(2)"&lt;/span&gt; &lt;span class="nt"&gt;-lhelloworld3&lt;/span&gt;.lua &lt;span class="nt"&gt;-Lhelloworld4&lt;/span&gt;.lua &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 1 2 3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And it just works.&lt;/p&gt;

</description>
      <category>lua</category>
      <category>repl</category>
      <category>luaconsole</category>
    </item>
  </channel>
</rss>
