<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://blog.tekwizely.com</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 08:28:07 GMT</lastBuildDate><atom:link href="https://blog.tekwizely.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Running Your BATS Tests Against Multiple Bash Versions in GitHub]]></title><description><![CDATA[In this post I'll go over the github workflow I created that allows me to test bash scripts using BATS against multiple versions of Bash.
TL;DR: See my github workflow : bats-multi-bash.yml
My Bash Script
The script in question is my Bash-TPL project...]]></description><link>https://blog.tekwizely.com/running-your-bats-tests-against-multiple-bash-versions-in-github</link><guid isPermaLink="true">https://blog.tekwizely.com/running-your-bats-tests-against-multiple-bash-versions-in-github</guid><category><![CDATA[Bash]]></category><category><![CDATA[Testing]]></category><category><![CDATA[ci-cd]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[github-actions]]></category><dc:creator><![CDATA[TekWizely]]></dc:creator><pubDate>Fri, 12 Nov 2021 22:50:11 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1656540867563/UScK_IZrB.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this post I'll go over the github workflow I created that allows me to test bash scripts using BATS against multiple versions of Bash.</p>
<p>TL;DR: See my github workflow : <a target="_blank" href="https://github.com/TekWizely/bash-tpl/blob/main/.github/workflows/bats-multi-bash.yml">bats-multi-bash.yml</a></p>
<h3 id="heading-my-bash-script">My Bash Script</h3>
<p>The script in question is my <a target="_blank" href="https://github.com/TekWizely/bash-tpl">Bash-TPL</a> project, which is a light-weight shell-scripting template engine.</p>
<h3 id="heading-my-testing-framework">My Testing Framework</h3>
<p>I chose <a target="_blank" href="https://github.com/bats-core/bats-core">BATS</a> as the testing framework, as its comprehensive, tests are easy to write, and its Bash all the way down !</p>
<p>I had already written an extensive suite of tests, so I was confident they would reveal any compatibility issues once I figured out how to run them against older Bash versions.</p>
<h3 id="heading-finding-older-bash-versions">Finding Older Bash Versions</h3>
<p>In researching <em>how</em> I was going to run my tests against older bash versions, I discovered the <a target="_blank" href="https://hub.docker.com/_/bash">Official Bash Docker Repository</a></p>
<h4 id="heading-local-testing">Local Testing</h4>
<p>This made running the tests on a specific bash version very easy to do on my local machine:</p>
<pre><code>$ docker <span class="hljs-comment">--rm -it -v"${PWD}:/bash-tpl" bash:3.2</span>

bash-3.2<span class="hljs-comment"># apk add bats diffutils</span>
<span class="hljs-comment"># ...</span>
OK: 8 MiB in 21 packages

bash-3.2<span class="hljs-comment"># cd /bash-tpl</span>
bash-3.2<span class="hljs-comment"># bats test</span>

1..92
ok 1 BASH_TPL_TAG_DELIMS: Should <span class="hljs-keyword">do</span> <span class="hljs-keyword">nothing</span> <span class="hljs-keyword">when</span> unset <span class="hljs-keyword">or</span> <span class="hljs-keyword">empty</span>
ok <span class="hljs-number">2</span> BASH_TPL_TAG_DELIMS: Should <span class="hljs-keyword">error</span> <span class="hljs-keyword">on</span> invalid <span class="hljs-keyword">input</span>
ok <span class="hljs-number">3</span> BASH_TPL_TAG_DELIMS: Should process valid <span class="hljs-keyword">input</span>
<span class="hljs-comment"># OK looking good !</span>
<span class="hljs-comment"># ...</span>
<span class="hljs-comment"># DOH!</span>
<span class="hljs-keyword">not</span> ok <span class="hljs-number">42</span> misc-<span class="hljs-keyword">function</span>: escape_regex
<span class="hljs-keyword">not</span> ok <span class="hljs-number">43</span> misc-<span class="hljs-keyword">function</span>: normalize_directive
<span class="hljs-comment"># ...</span>
</code></pre><h4 id="heading-hate-compatibility-much">Hate Compatibility Much?</h4>
<p>So it turned out that my script <strong>only</strong> worked on Bash 5.1 :(</p>
<h4 id="heading-checking-multiple-bash-versions">Checking Multiple Bash Versions</h4>
<p>Once I identified all of the compatibility issues, I was able to work on fixing them, using the above technique to test against multiple Bash versions.  Specifically, I ran tests against:</p>
<ul>
<li>Bash Version 3.2 (<code>bash:3.2</code>)</li>
<li>Bash Version 4.4 (<code>bash:4.4</code>)</li>
<li>Bash Version 5.0 (<code>bash:5.0</code>)</li>
<li>Bash Version 5.1 (<code>bash:5.1</code>)</li>
</ul>
<h3 id="heading-auto-detecting-future-issues">Auto-Detecting Future Issues</h3>
<p>Having successfully fixed the compatibility issues, and <a target="_blank" href="https://github.com/TekWizely/bash-tpl/releases/tag/v0.4.0">making a new release</a>, I set out to create a github workflow to run these tests for me in the future.</p>
<h3 id="heading-workflow-research">Workflow Research</h3>
<h4 id="heading-bash-docker-images">Bash Docker Images</h4>
<p>I had to determine <strong>if</strong> I could utilize the previously discovered Bash docker images within a github workflow.</p>
<h5 id="heading-run-a-single-bash-image">Run a Single Bash Image</h5>
<p>My first goal was to determine if I could run the workflow within just a <em>single</em> docker image.</p>
<p>Thanks to the well-documented <a target="_blank" href="https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions">Workflow Syntax For Github Guide</a>, I discovered the <a target="_blank" href="https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idcontainer">jobs.\.container</a> configuration.</p>
<pre><code><span class="hljs-attribute">jobs</span>:
  <span class="hljs-attribute">my_job</span>:
    <span class="hljs-attribute">container</span>:
      <span class="hljs-attribute">image</span>: <span class="hljs-string">"bash:3.2"</span>
</code></pre><p>This will run your job steps inside the specified container !</p>
<h4 id="heading-configuring-bats">Configuring BATS</h4>
<p>Next I needed to install BATS into my fresh new Bash container.</p>
<p>I knew I could issue an <code>apk add bats</code> command, but I wanted to have more control over the actual version of BATS being used.</p>
<h5 id="heading-github-actions-marketplace">GitHub Actions Marketplace</h5>
<p>I figured I probably wasn't the first person who wanted to run BATS in a workflow, so I searched the <a target="_blank" href="https://github.com/marketplace?type=actions">github actions marketplace</a>.</p>
<p>Sure enough, there was already an action for configuring BATS:</p>
<ul>
<li>https://github.com/marketplace/actions/setup-bats-testing-framework</li>
</ul>
<p>Most importantly, it allows you to declare <em>which</em> version of BATS you want to install.</p>
<p>For me, that was the shiny new <a target="_blank" href="https://github.com/bats-core/bats-core/releases/tag/v1.5.0">1.5.0</a>:</p>
<pre><code><span class="hljs-attribute">jobs</span>:
  <span class="hljs-attribute">my_job</span>:
    <span class="hljs-attribute">steps</span>:
      - <span class="hljs-attribute">name</span>: Setup BATS
        <span class="hljs-attribute">uses</span>: mig4/setup-bats<span class="hljs-variable">@v1</span>
        <span class="hljs-attribute">with</span>:
          <span class="hljs-attribute">bats-version</span>: <span class="hljs-number">1.5</span>.<span class="hljs-number">0</span>
</code></pre><h4 id="heading-multiple-bash-versions">Multiple Bash Versions</h4>
<p>Now that I could successfully run my tests using a single container, it was time to figure out how to use multiple containers.</p>
<h5 id="heading-enter-the-matrix">Enter The Matrix</h5>
<p>From the github workflow documentation of the <a target="_blank" href="https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix">jobs.\.strategy.matrix</a> strategy:</p>
<blockquote>
<p>You can define a matrix of different job configurations. A matrix allows you to create multiple jobs by performing variable substitution in a single job definition. For example, you can use a matrix to create jobs for more than one supported version of a programming language, operating system, or tool. A matrix reuses the job's configuration and creates a job for each matrix you configure.</p>
</blockquote>
<h5 id="heading-not-exactly-new">Not Exactly New</h5>
<p>I first learned about the <a target="_blank" href>github workflow matrix</a> strategy when implementing <a target="_blank" href="https://github.com/jgehrcke/github-repo-stats#tracking-multiple-repos">github-repo-stats</a> to save stat history for all of my repositories.</p>
<h5 id="heading-but-what-about-containers">But What About Containers?</h5>
<p>But I couldn't find any examples of a matrix being used for <code>container</code> setup.</p>
<h5 id="heading-favors-the-bold">... Favors The Bold</h5>
<p>I decided to give a try anyway - And It Worked !</p>
<pre><code><span class="hljs-attr">jobs:</span>
  <span class="hljs-attr">my_job:</span>
    <span class="hljs-attr">strategy:</span>
      <span class="hljs-attr">matrix:</span>
        <span class="hljs-attr">bash:</span> [<span class="hljs-string">"bash:3.2"</span>, <span class="hljs-string">"bash:4.4"</span>, <span class="hljs-string">"bash:5.0"</span>, <span class="hljs-string">"bash:5.1"</span>]
    <span class="hljs-attr">container:</span> 
      <span class="hljs-attr">image:</span> <span class="hljs-string">${{</span> <span class="hljs-string">matrix.bash</span> <span class="hljs-string">}}</span>
</code></pre><h3 id="heading-putting-it-all-together">Putting It All Together</h3>
<p>Now that I had all the pieces worked out, I could <em>finally</em> implement my workflow.</p>
<p>Below is the version of the workflow at the time of posting:</p>
<p><em>bats-multi-bash.yml</em></p>
<pre><code><span class="hljs-attribute">name</span>: BATS Tests

<span class="yaml"><span class="hljs-attr">on:</span>
  <span class="hljs-attr">push:</span>
    <span class="hljs-attr">branches:</span> [ <span class="hljs-string">main</span> ]
  <span class="hljs-attr">pull_request:</span>
    <span class="hljs-attr">branches:</span> [ <span class="hljs-string">main</span> ]

  <span class="hljs-attr">workflow_dispatch:</span>

<span class="hljs-attr">jobs:</span>
  <span class="hljs-attr">bats:</span>
    <span class="hljs-attr">runs-on:</span> <span class="hljs-string">ubuntu-latest</span>
    <span class="hljs-attr">strategy:</span>
      <span class="hljs-attr">matrix:</span>
        <span class="hljs-attr">bash:</span> [<span class="hljs-string">"bash:3.2"</span>, <span class="hljs-string">"bash:4.4"</span>, <span class="hljs-string">"bash:5.0"</span>, <span class="hljs-string">"bash:5.1"</span>]
    <span class="hljs-attr">container:</span> 
      <span class="hljs-attr">image:</span> <span class="hljs-string">${{</span> <span class="hljs-string">matrix.bash</span> <span class="hljs-string">}}</span>
    <span class="hljs-attr">steps:</span>
      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Install</span> <span class="hljs-string">packages</span>
        <span class="hljs-attr">run:</span> <span class="hljs-string">apk</span> <span class="hljs-string">add</span> <span class="hljs-string">diffutils</span>

      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Setup</span> <span class="hljs-string">BATS</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">mig4/setup-bats@v1.2.0</span>
        <span class="hljs-attr">with:</span>
          <span class="hljs-attr">bats-version:</span> <span class="hljs-number">1.5</span><span class="hljs-number">.0</span>

      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Checkout</span> <span class="hljs-string">code</span>
        <span class="hljs-attr">uses:</span> <span class="hljs-string">actions/checkout@v2</span>

      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Run</span> <span class="hljs-string">bash-tpl</span> <span class="hljs-string">tests</span>
        <span class="hljs-attr">run:</span> <span class="hljs-string">bats</span> <span class="hljs-string">test/</span>

      <span class="hljs-bullet">-</span> <span class="hljs-attr">name:</span> <span class="hljs-string">Run</span> <span class="hljs-string">template</span> <span class="hljs-string">tests</span>
        <span class="hljs-attr">run:</span> <span class="hljs-string">bats</span> <span class="hljs-string">test/tpl</span></span>
</code></pre><h3 id="heading-results">Results</h3>
<p>The BATS tests run successfully on all specified Bash versions, <strong>and they're fast!</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1656540867563/UScK_IZrB.png" alt="BATS Test Results Against Multiple Bash Versions" /></p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>Thank you for reading - I hope you found this post helpful.  Please let me know if you have any comments or questions.</p>
<p>-TekWizely</p>
]]></content:encoded></item><item><title><![CDATA[My-Alternatives: A wrapper for update-alternatives offering user-level customizations. Supports Debian, SUSE, and RedHat]]></title><description><![CDATA[I'm excited to announce release v0.7.0 of my-alternatives

https://github.com/TekWizely/my-alternatives 

My-Alternatives is a light-weight wrapper over update-alternatives, offering user-level customizations.
Supports Debian, SUSE, and RedHat

Easy ...]]></description><link>https://blog.tekwizely.com/my-alternatives-a-wrapper-for-update-alternatives-offering-user-level-customizations-supports-debian-suse-and-redhat</link><guid isPermaLink="true">https://blog.tekwizely.com/my-alternatives-a-wrapper-for-update-alternatives-offering-user-level-customizations-supports-debian-suse-and-redhat</guid><category><![CDATA[ShowHashnode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[debian]]></category><category><![CDATA[redhat]]></category><category><![CDATA[suse]]></category><dc:creator><![CDATA[TekWizely]]></dc:creator><pubDate>Wed, 10 Nov 2021 21:40:00 GMT</pubDate><content:encoded><![CDATA[<p>I'm excited to announce release v0.7.0 of <code>my-alternatives</code></p>
<ul>
<li>https://github.com/TekWizely/my-alternatives </li>
</ul>
<p>My-Alternatives is a light-weight wrapper over update-alternatives, offering user-level customizations.</p>
<p>Supports Debian, SUSE, and RedHat</p>
<hr />
<h2 id="heading-easy-to-get-started">Easy to Get Started</h2>
<p>With my-alternatives, configuring custom alternatives is as easy as:</p>
<pre><code><span class="hljs-comment"># initialize my-alternatives</span>
<span class="hljs-comment"># note: place this in your .profile</span>
$ <span class="hljs-keyword">eval</span> <span class="hljs-string">"$( my-alternatives init )"</span>

<span class="hljs-comment"># customize an alternative</span>
$ <span class="hljs-keyword">my</span>-alternatives <span class="hljs-keyword">select</span> &lt;name&gt;
</code></pre><p>See the <a target="_blank" href="https://github.com/TekWizely/my-alternatives">Project's Homepage</a> for more information</p>
<hr />
<h2 id="heading-release-notes-v070">Release Notes - v0.7.0</h2>
<h3 id="heading-re-write">Re-Write</h3>
<p>This release marks a full re-write of the my-alternatives tool, changing it into wrapper for <em>update-alternatives</em> that manages user-level configurations and uses them when invoking update-alternatives (i.e <code>--admindir</code> &amp; <code>--altdir</code>).</p>
<p>This new approach makes it much easier to support <strong>all</strong> available commands for managing your custom alternatives.</p>
<h3 id="heading-redhat">RedHat</h3>
<p>This release also includes support for <em>RedHat</em>.</p>
<p>This is significant because RedHat maintains its own implementation of <em>update-alternatives</em>, which is slightly different than the <em>Debian</em> version.</p>
<p>The RedHat version does not include the uber-useful <code>--query</code> command, making it impossible to integrate it using <em>just</em> the public API.</p>
<p>As such, supporting it requires a <em>hack</em>, exploiting knowledge of the tool's private internals.</p>
<h3 id="heading-suse">SUSE</h3>
<p>The SUSE implementation of <em>update-alternatives</em> is really just a re-branded version of the Debian tool.</p>
<h3 id="heading-multiple-scripts">Multiple Scripts</h3>
<p>As part of introducing RedHat support, this release now includes two versions of the <code>my-alternatives</code> script, each named according to the primary OS flavor they support:</p>
<ul>
<li>Debian / SUSE : <code>my-alternatives-debian</code></li>
<li>RedHat / CentOS : <code>my-alternatives-redhat</code></li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Bash-TPL - A smart, lightweight shell script templating engine]]></title><description><![CDATA[I know the landscape is crowded, but I'd like to offer my submission for an Easy To Use / Easy To Maintain template engine:
Introducing Bash-TPL : A Smart, lightweight shell script templating engine, written in Bash

https://github.com/TekWizely/bash...]]></description><link>https://blog.tekwizely.com/bash-tpl-a-smart-lightweight-shell-script-templating-engine</link><guid isPermaLink="true">https://blog.tekwizely.com/bash-tpl-a-smart-lightweight-shell-script-templating-engine</guid><category><![CDATA[ShowHashnode]]></category><category><![CDATA[Bash]]></category><category><![CDATA[template]]></category><category><![CDATA[template-engine]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[TekWizely]]></dc:creator><pubDate>Sat, 18 Sep 2021 16:46:24 GMT</pubDate><content:encoded><![CDATA[<p>I know the landscape is crowded, but I'd like to offer my submission for an Easy To Use / Easy To Maintain template engine:</p>
<p>Introducing Bash-TPL : A Smart, lightweight shell script templating engine, written in Bash</p>
<ul>
<li><a target="_blank" href="https://github.com/TekWizely/bash-tpl">https://github.com/TekWizely/bash-tpl</a></li>
</ul>
<h4 id="heading-features">FEATURES</h4>
<h5 id="heading-lightweight">Lightweight</h5>
<ul>
<li>Single bash script</li>
<li>Easy to ship with your project or build process</li>
</ul>
<h5 id="heading-smart-indentation-tracking">Smart Indentation Tracking</h5>
<ul>
<li>Removes unwanted whitespace from rendered text files</li>
<li>Encourages well-formatted mix of template tags and textual content</li>
</ul>
<h5 id="heading-generates-reusable-shell-scripts">Generates Reusable Shell Scripts</h5>
<ul>
<li>Can manage &amp; invoke shell scripts without bash-tpl</li>
<li>Only need bash-tpl when your source templates change</li>
</ul>
<h5 id="heading-shell-agnostic">Shell Agnostic</h5>
<ul>
<li>Uses standard printf, variable, and sub-shell constructs</li>
<li>Templates can target any modern shell</li>
</ul>
<h5 id="heading-supports-includes">Supports Includes</h5>
<ul>
<li>Can organize your templates as smaller, reusable components</li>
<li>Indentation tracking even works across includes !</li>
</ul>
<h5 id="heading-flexible-delimiter-support">Flexible Delimiter Support</h5>
<ul>
<li>Can customize all template delimiters</li>
<li>Can modify delimiters mid-template</li>
<li>Can include templates with differing delimiters</li>
</ul>
<hr />
<h4 id="heading-quick-example">Quick Example</h4>
<p>As is the way: A quintessential <em>hello world</em> example is of course in order:</p>
<p><em>hello.tpl</em></p>
<pre><code>Hello, <span class="hljs-operator">&lt;</span><span class="hljs-operator">%</span> ${NAME:<span class="hljs-operator">-</span>World} <span class="hljs-operator">%</span><span class="hljs-operator">&gt;</span>
</code></pre><p><em>compile + run</em></p>
<pre><code>$ source <span class="hljs-operator">&lt;</span>( bash<span class="hljs-operator">-</span>tpl hello.tpl )

Hello, World
</code></pre><p><em>compile + run with NAME</em></p>
<pre><code>$ NAME<span class="hljs-operator">=</span>TekWizely source <span class="hljs-operator">&lt;</span>( bash<span class="hljs-operator">-</span>tpl hello.tpl )

Hello, TekWizely
</code></pre><p><em>view compiled template</em></p>
<pre><code>$ bash-tpl hello.tpl

<span class="hljs-built_in">printf</span> <span class="hljs-string">"%s\n"</span> Hello\,\ <span class="hljs-string">"<span class="hljs-variable">${NAME:-World}</span>"</span>
</code></pre><hr />
<h4 id="heading-more-information">More Information</h4>
<p>This hello example is really just the start of what bash-tpl can do.</p>
<p>There's a full README on the <a target="_blank" href="https://github.com/TekWizely/bash-tpl">Project Home Page</a>.</p>
<p>If you're looking for an easy solution for creating maintainable templates to generate well-formatted text files, I hope you'll give my project a try.</p>
<p>I'm happy to answer any questions or work through any use-cases you might have for templates and see how bash-tpl might help.</p>
<p>Feel free to comment and thanks for looking!</p>
<p>-TW</p>
]]></content:encoded></item><item><title><![CDATA[Bingo - The missing package manager for golang binaries]]></title><description><![CDATA[Introduction
Do you love the simplicity of being able to download & compile golang applications with 'go get', but wish it were easier to manage the compiled binaries?
Introducing Bingo:

GitHub : https://github.com/TekWizely/bingo

Bingo makes insta...]]></description><link>https://blog.tekwizely.com/bingo-the-missing-package-manager-for-golang-binaries</link><guid isPermaLink="true">https://blog.tekwizely.com/bingo-the-missing-package-manager-for-golang-binaries</guid><category><![CDATA[ShowHashnode]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Go Language]]></category><dc:creator><![CDATA[TekWizely]]></dc:creator><pubDate>Mon, 17 Feb 2020 20:11:48 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Do you love the simplicity of being able to download &amp; compile golang applications with <code>'go get'</code>, but wish it were easier to manage the compiled binaries?</p>
<p>Introducing Bingo:</p>
<ul>
<li>GitHub : https://github.com/TekWizely/bingo</li>
</ul>
<p>Bingo makes installing and managing golang-compiled binaries a bit easier.</p>
<h3 id="heading-features">Features</h3>
<ul>
<li>Keeps a link between the installed binary and the source package</li>
<li>Can install binaries to a location of your choice</li>
<li>Can control the name of the installed binary</li>
<li>Can install multiple versions of the same package (using different names for the binary)</li>
<li>Each binary's source package is isolated and managed in its own separate <code>$GOROOT</code></li>
</ul>
<hr />
<h2 id="heading-examples">Examples</h2>
<h3 id="heading-compiling-installing-binaries">Compiling + Installing Binaries</h3>
<p>To install a binary with bingo, use the golang application's full package path, same as you would with <code>'go get'</code>.</p>
<p><em>hello example</em></p>
<pre><code>$ bingo install github.com/golang<span class="hljs-operator">/</span>example<span class="hljs-operator">/</span>hello

Installing binary hello <span class="hljs-keyword">from</span> package github.com/golang<span class="hljs-operator">/</span>example<span class="hljs-operator">/</span>hello
Downloading package (folder: <span class="hljs-string">'~/.bingo/pkg/hello'</span>)
Compiling package
Installing binary (file: <span class="hljs-string">'~/.bingo/bin/hello'</span>)
Done

$ <span class="hljs-operator">~</span><span class="hljs-operator">/</span>.bingo/bin<span class="hljs-operator">/</span>hello

Hello, Go examples<span class="hljs-operator">!</span>
</code></pre><h4 id="heading-binary-naming">Binary Naming</h4>
<p>By default, the installed binary will be named after the last folder element in its package path.</p>
<p>As you saw above, installing the <code>github.com/golang/example/hello</code> package installed a binary named <code>hello</code>.</p>
<p>You can override this behavior and specify the binary name at the time of installation:</p>
<p><em>install hello example as 'foo'</em></p>
<pre><code>$ bingo install <span class="hljs-operator">-</span>n foo <span class="hljs-operator">-</span>q github.com/golang<span class="hljs-operator">/</span>example<span class="hljs-operator">/</span>hello

$ <span class="hljs-operator">~</span><span class="hljs-operator">/</span>.bingo/bin<span class="hljs-operator">/</span>foo

Hello, Go examples<span class="hljs-operator">!</span>
</code></pre><h3 id="heading-listing-installed-binaries">Listing Installed Binaries</h3>
<p>To see a list of installed binaries, use the <code>installed</code> command:</p>
<pre><code>$ bingo installed <span class="hljs-operator">-</span>p

Bingo<span class="hljs-operator">-</span>managed binaries (folder: <span class="hljs-string">'~/.bingo/bin'</span>)

 <span class="hljs-operator">-</span> foo github.com/golang<span class="hljs-operator">/</span>example<span class="hljs-operator">/</span>hello
 <span class="hljs-operator">-</span> hello github.com/golang<span class="hljs-operator">/</span>example<span class="hljs-operator">/</span>hello
</code></pre><h2 id="heading-displaying-a-binarys-associated-package">Displaying A Binary's Associated Package</h2>
<p>If you need a reminder of which package a binary was compiled/installed from, you can use the <code>package</code> command:</p>
<pre><code>$ bingo package hello

github.com/golang<span class="hljs-operator">/</span>example<span class="hljs-operator">/</span>hello
</code></pre><h3 id="heading-uninstalling-binaries-packages">Uninstalling Binaries / Packages</h3>
<p>Use the <code>uninstall</code> command to uninstall binaries:</p>
<pre><code>$ bingo <span class="hljs-keyword">uninstall</span> foo

Uninstalling <span class="hljs-built_in">binary</span> foo <span class="hljs-keyword">from</span> <span class="hljs-keyword">package</span> github.com/golang/example/hello
Removing <span class="hljs-built_in">binary</span> (<span class="hljs-keyword">file</span>: <span class="hljs-string">'~/.bingo/bin/foo'</span>)
Removing <span class="hljs-keyword">package</span> (folder: <span class="hljs-string">'~/.bingo/pkg/foo'</span>)
Done

$ bingo installed -q

hello
</code></pre><p><em>NOTE</em>: Uninstalling a binary also removes the associated package folder.</p>
<hr />
<h2 id="heading-requirements">Requirements</h2>
<h3 id="heading-run">Run</h3>
<p>Bingo exists as a Runfile, and requires the Run tool to operate:</p>
<ul>
<li>https://github.com/TekWizely/run</li>
</ul>
<h3 id="heading-bash">Bash</h3>
<p>Bingo (currently) uses <code>bash</code> for its command scripts.</p>
<h3 id="heading-readlink">Readlink</h3>
<p>Bingo uses symbolic links to associate binaries to their packages.</p>
<p>The scripts use <code>readlink</code> to resolve symbolic links.</p>
<hr />
<h2 id="heading-installing-bingo">Installing Bingo</h2>
<h3 id="heading-releases">Releases</h3>
<p>See the <a target="_blank" href="https://github.com/TekWizely/bingo/releases">Releases</a> page for downloadable archives of versioned releases.</p>
<h3 id="heading-brew-tap">Brew Tap</h3>
<p>While brew core support is in the works, I have also created a tap to ensure the latest version is always available:</p>
<ul>
<li>https://github.com/TekWizely/homebrew-tap</li>
</ul>
<p><em>install bingo directly from tap</em></p>
<pre><code>$ brew install tekwizely<span class="hljs-operator">/</span>tap<span class="hljs-operator">/</span>bingo
</code></pre><p><em>install tap to track updates</em></p>
<pre><code>$ brew tap tekwizely/tap

$ brew install bingo
</code></pre><hr />
<h2 id="heading-configuration">Configuration</h2>
<p>See the <a target="_blank" href="https://github.com/TekWizely/bingo#work-folders">Work Folders</a> section on the project's main page for details on configuring the various folders needed by bingo, including which folder to install binaries in.</p>
<hr />
<h2 id="heading-license">License</h2>
<p>The <code>tekwizely/bingo</code> project is released under the <a target="_blank" href="https://opensource.org/licenses/MIT">MIT</a> License.</p>
<hr />
<h2 id="heading-conclusion-a-toy-trying-to-take-itself-seriously">Conclusion - A Toy Trying To Take Itself Seriously</h2>
<p>Although designed as a set of toy scripts to play around with the idea, bingo is trying to take itself seriously and make a real run at being a useful tool.</p>
<p>If you're looking for better ways to manage binaries installed via <code>'go get'</code>, I hope you will give my project a try.</p>
<p>I am happy to answer any questions you might have.</p>
<p>Thank you for your time,</p>
<p>-TekWizely ( https://github.com/TekWizely )</p>
]]></content:encoded></item><item><title><![CDATA[Run - Easily manage and invoke small scripts and wrappers (Written in Golang)]]></title><description><![CDATA[Introduction
Do you find yourself using tools like make to manage non build-related scripts?
Build tools are great, but they are not optimized for general script management.
Introducing Run:
 GitHub : https://github.com/TekWizely/run
Run aims to be b...]]></description><link>https://blog.tekwizely.com/run-easily-manage-and-invoke-small-scripts-and-wrappers-written-in-golang</link><guid isPermaLink="true">https://blog.tekwizely.com/run-easily-manage-and-invoke-small-scripts-and-wrappers-written-in-golang</guid><category><![CDATA[ShowHashnode]]></category><category><![CDATA[Go Language]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[Task Runner]]></category><dc:creator><![CDATA[TekWizely]]></dc:creator><pubDate>Fri, 20 Dec 2019 21:12:37 GMT</pubDate><content:encoded><![CDATA[<h1 id="heading-introduction">Introduction</h1>
<p>Do you find yourself using tools like <code>make</code> to manage non build-related scripts?</p>
<p>Build tools are great, but they are not optimized for general script management.</p>
<p>Introducing Run:</p>
<p> GitHub : https://github.com/TekWizely/run</p>
<p>Run aims to be better at managing small scripts and wrappers, while incorporating a familiar make-like syntax.</p>
<h1 id="heading-features">Features</h1>
<p>Here are a few of Run's features:</p>
<ul>
<li>Terse, make-like syntax</li>
<li>Manage multiple script types: Bash, Python, Ruby, etc.</li>
<li>Automatic help text generation</li>
<li>Command scripts are executed in a single sub-shell, not like make's (default) behavior of executing each line of a recipe in a separate sub-shell.</li>
<li>Define cli options and have the values passed to your scripts as environment variables.</li>
</ul>
<h1 id="heading-runfile">Runfile</h1>
<p>Where make has the ubiquitous Makefile, run has the cleverly-named <code>"Runfile"</code></p>
<p>By default, run will look for a file named <code>"Runfile"</code> in the current directory, exiting with error if not found.</p>
<p>See the project README for details on specifying alternative runfiles, as well as other special modes you might find useful.</p>
<h1 id="heading-hello-world-example">Hello World Example</h1>
<p>The project's README starts with a much simpler example and walks through the various features, but I thought I would share a more fleshed out example to demonstrate several of the features together:</p>
<p><em>Runfile</em></p>
<pre><code><span class="hljs-comment">##</span>
<span class="hljs-comment"># Hello world example.</span>
<span class="hljs-comment"># Prints "Hello, &lt;name&gt;".</span>
<span class="hljs-comment"># OPTION NAME -n,--name &lt;name&gt; Name to say hello to</span>
hello:
  <span class="hljs-built_in">echo</span> <span class="hljs-string">"Hello, <span class="hljs-variable">${NAME:-World}</span>"</span>
</code></pre><p><em>list commands</em></p>
<pre><code>$ run list

Commands:
  list     (builtin) List available commands
  help     (builtin) Show Help <span class="hljs-keyword">for</span> a command
  hello    Hello world example.
Usage:
       run [<span class="hljs-operator">-</span>r runfile] help <span class="hljs-operator">&lt;</span>command<span class="hljs-operator">&gt;</span>
          (show help <span class="hljs-keyword">for</span> <span class="hljs-operator">&lt;</span>command<span class="hljs-operator">&gt;</span>)
  or   run [<span class="hljs-operator">-</span>r runfile] <span class="hljs-operator">&lt;</span>command<span class="hljs-operator">&gt;</span> [option ...]
          (run <span class="hljs-operator">&lt;</span>command<span class="hljs-operator">&gt;</span>)
</code></pre><p><em>show help for hello command</em></p>
<pre><code>$ run help hello

hello:
  Hello world example.
  Prints <span class="hljs-string">"Hello, &lt;name&gt;"</span>.
Options:
  <span class="hljs-operator">-</span>h, <span class="hljs-operator">-</span><span class="hljs-operator">-</span>help
        Show full help screen
  <span class="hljs-operator">-</span>n, <span class="hljs-operator">-</span><span class="hljs-operator">-</span>name <span class="hljs-operator">&lt;</span>name<span class="hljs-operator">&gt;</span>
        Name to say hello to
</code></pre><p><em>invoke hello command with no options</em></p>
<pre><code>$ run hello

Hello, World
</code></pre><p><em>invoke hello command with options</em></p>
<pre><code>$ run hello <span class="hljs-operator">-</span><span class="hljs-operator">-</span>name<span class="hljs-operator">=</span>Newman
$ run hello <span class="hljs-operator">-</span>n Newman

Hello, Newman
</code></pre><h1 id="heading-installing">Installing</h1>
<p>Currently, installing requires using <code>go get</code>, but there is an active PR for a <code>brew</code> formula and I'm also working on a <code>PKGBUILD</code> file.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>If you're at all interested in managing task runners and scripts, I hope you will give my project a try.</p>
<p>I am happy to answer any questions you might have.</p>
<p>Thank you for your time and Happy Holidays!</p>
<p>-TekWizely ( https://github.com/TekWizely )</p>
]]></content:encoded></item></channel></rss>