-- Now in BETA! --

How To Use Lickety Script

Part one : the Lickety Script app

For part one, you use the Lickety Script application to generate your script.

Navigate to Lickety Script

Use the menu to get there.

Enter the script's name

This is the command that will you want to execute on the command line. e.g. my-script.sh. This example script is executed with add-two-numbers.sh. So the name is add-two-numbers.

Enter the script's argument

The script in this example has two args: num-one and num-two.

Enter argument num-one and its details

Click the add button to create a new argument.

Enter details in the detail section

Change the name to num-one. Add short name as -o and relevant help text. Toggle the validation to required.

Add argument num-two and enter its details

Click the add button to create a new argument and enter details as before but for num-two. Short name as t, help text, and toggle validation to required.

Click the create script button

This will download aa zip file with script framework. This zip file will contain everything you need to install and run your script -- minus your custom code that you haven't written yet

Inspect the zip file's contents

On Linux/Mac you can run 'unzip -l add-two-numbers.zip' to show you the contents. If yours looks like this, part one is complete. Move to part two. If it doesn't then something is broken and let me know about it on twitter

Part two : Install the script

Once you have the zip file, you can install it on your computer.

Unzip and make installer.sh executable

Run the following commands.

  1. unzip add-two-numbers.zip
  2. cd add-two-numbers
  3. chmod +x installer.sh
  4. ./installer.sh

Update your path

The installer puts the files in various subdirectories in $HOME/.lickety-script.

Update your $HOME/.bash_profile to include the following lines.

  1. export PATH=$HOME/.lickety-script/bin:$PATH
  2. export LICKETY_SCRIPT_HOME=$HOME/.lickety-script/

Reload your shell or run 'source $HOME/.bash_profile'

Run the script

Run 'add-two-numbers.sh -h'

Test run with arguments.

Run with arguments set and in verbose mode: 'add-two-numbers.sh -v --num-one 5 --num-two 3'

Part three : Implement

Locate install directory

Go to script's directory in the Lickety Script home directory in : 'cd $HOME/.lickety-script/scripts/add-two-numbers'

Edit main script file

Edit the main script file and add your implementation. In this example we're adding two numbers together and we'll use the Linux command 'bc'.

Edit the file with vi or your favorite text editor. 'vi add-two-numbers.sh'

Add the line 'bc "$NUM_DASH_ONE_ARG + $NUM_DASH_TWO_ARG"' at the bottom of the add-two-numbers.sh file. Save the file.

Run it!

Give it a test run with 'add-two-numbers.sh -o 6 -t 3' and see the result.

You're done

You can see how Lickety Script takes care of all the parsing, validation, and help menu creation. It leaves you with the task of the script's implementation.

Now you can start experimenting and building your own scripts much faster and easier than before.

If you run into any issues or have any questions, please let me know on one of the various channels.



Lickety-Script Github