PHPackages                             php-developer/jumpstart-bash - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. php-developer/jumpstart-bash

ActiveProject[Utility &amp; Helpers](/categories/utility)

php-developer/jumpstart-bash
============================

Bash script template.

681[2 issues](https://github.com/jmurowaniecki/jumpstart-bash/issues)Shell

Since Jan 2Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jmurowaniecki/jumpstart-bash)[ Packagist](https://packagist.org/packages/php-developer/jumpstart-bash)[ RSS](/packages/php-developer-jumpstart-bash/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

[![](assets/jumpstart.png)](assets/jumpstart.png) Jump Start
============================================================

[](#-jump-start)

[![StyleCI](https://camo.githubusercontent.com/a7c4f2850748102c5ad65f5060c04d93fbda2ec29a0151ea12fad077b467350b/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130323030313937392f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/102001979) [![Codacy Badge](https://camo.githubusercontent.com/f4c56d8abf1d6613fefadf8fa6ff4bdb24199a3b093f55cdc83a4205d5d41a5f/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3863303234333237333533373431383339343133323936363530666538383366)](https://www.codacy.com/app/jmurowaniecki/jumpstart-bash?utm_source=github.com&utm_medium=referral&utm_content=jmurowaniecki/jumpstart-bash&utm_campaign=Badge_Grade)

**Jump Start** was concepted to be an easy and lightweight boilerplate for your tools using modularity to manage readability and producing a self-deployment solution. Although you can use `jumpstart` to handle self-contained tools, it can be used to manage multiple recipes in a *global* environment.

Aiming to solve structural gaps due to some [classical language limitations](https://mywiki.wooledge.org/BashWeaknesses), allowing to perform autocompletion and generate documentation based initially on function declarations source code annotations, **Jump Start** intent to be your weapon of choice to start from small sized projects to complex solutions without leaving your [state of art](https://github.com/jlevy/the-art-of-command-line).

[Bash is a really powerfull tool](https://www.tldp.org/LDP/abs/html/) and there are a lot of [online documentation](http://web.mit.edu/~linux/docs/howto/Adv-Bash-Scr-HOWTO), [good](https://github.com/bahamas10/bash-style-guide) [practices](https://devmanual.gentoo.org/tools-reference/bash/), [style guidance](https://google.github.io/styleguide/shell.xml), advices and tools for [validation, static analysis and linting](https://github.com/koalaman/shellcheck) to ensure code quality and maintainability.

Getting start
-------------

[](#getting-start)

### Instalation

[](#instalation)

### Compatibility check

[](#compatibility-check)

### Hands on

[](#hands-on)

#### Creating a small and self-contained application

[](#creating-a-small-and-self-contained-application)

#### Creating a complex and self-deployable solution

[](#creating-a-complex-and-self-deployable-solution)

### Solving problems

[](#solving-problems)

Structure
---------

[](#structure)

#### \#! *(aka: Shebang)*

[](#-aka-shebang)

[Standart declaration of the program loader](https://en.wikipedia.org/wiki/Shebang_(Unix)) are commonly the first line of the executable file that specifies the interpreter and environmental parameters.

```
#!/usr/bin/env bash
```

> *Means that our script runs over Bash.*

#### Document heading

[](#document-heading)

Describes script name, description, usage, authors and how/where to get more information (repository links, and more).

```
#
# TITLE       : Template title.
# DESCRIPTION : Template description.
# AUTHOR      : Your Name
# DATE        : 20170825
# VERSION     : 7.6.2-33
# USAGE       : bash template.sh or ./template.sh or ..
# REPOSITORY  : https://github.com/YOUR_USER/your_project
#
```

#### Versioning

[](#versioning)

Use the ID and version variables to efficiently and efficiently track features and bugs by keeping those values up to date with your favorite versioner's tags [in the way that suits you best](http://semver.org/).

```
APP_TITLE="${Cb}λ${Cn} Template"

APP_MAJOR=0
APP_MINOR=0
APP_REVISION=0
APP_PATCH=0
#
#   AVOID change above the safety line.
#
# --------------------------------------- SAFETY LINE -------------
APP_VERSION="${APP_MAJOR}.${APP_MINOR}.${APP_REVISION}-${APP_PATCH}"
```

#### Development area *(fun zone)*

[](#development-area-fun-zone)

The functions below exemplify where to stay and how to document the functions so that they are properly displayed as options by the script helper.

```
function example {
    # Explains how documentation works

    $_e "I don't know what to do"
}

function colors {
    # Show color/style variable table

    $_e "Color/style variables:

    ${Cb}Cn${Cn}     ${Cn}Normal/reset${Cn}
    ${Cb}Cb${Cn}     ${Cb}Bold${Cn}
    ${Cb}Ci${Cn}     ${Ci}Italic${Cn}
    ${Cb}Cd${Cn}     ${Cd}Dark/gray${Cn}
    ${Cb}Cr${Cn}     ${Cr}Red${Cn}
    ${Cb}Cg${Cn}     ${Cg}Green${Cn}
    ${Cb}Cc${Cn}     ${Cc}Cian/Blue${Cn}
    ${Cb}Cy${Cn}     ${Cy}Yellow${Cn}"
}
```

> Note that the `$_e` variable is used as a substitute for the `echo -e` command as a sole aesthetic purpose.

#### Auxiliary functions

[](#auxiliary-functions)

Sets the default error message if the parameter entered is not a valid command.

```
#
#   AVOID change above the safety line.
#
# --------------------------------------- SAFETY LINE -------------
DEFAULT_ERROR_MESSAGE="Warning: ${Cb}$1${Cn} is an invalid command."
```

##### Lazy helper

[](#lazy-helper)

Displays help for supported application parameters.

```
function help {
    # Show this content.

    success message "${EMPTY}"

    $_e "
${APP_TITLE} v${APP_VERSION}

Usage: ${Cb}$0${Cn} [${Cb}help${Cn}|..] ..

Parameters:
"
    commands="$(grep 'function ' -A1
