Skip to content

Latest commit

 

History

History
76 lines (53 loc) · 2.06 KB

File metadata and controls

76 lines (53 loc) · 2.06 KB

What is combish

A quick and easy way to manage medium to large scale shell scripts/utilities, breaking down into several sections to avoid mental overload and help you focus coding.

Has very low barrier to learning and is basically just combining the shell script parts, hence "combish".

See README.txt for more details.

Available commands

Generate

Quickly generate scaffolding for a script. Run

  ~$ ./combish-cli generate <src_name>

Then write your scripts accordingly:

  • bootstrap section:

    • init/01 - generally, global vars are listed here, prioritized alphanumerically
    • init/10 - generally, functions that are used in "lib" sections
  • libries/functions

    • lib/<src_name> - for functions specific to your script
    • lib/common - if you think a function is reusable in other scripts, put it here and declare it in lib/<src_name>/common.txt

Build

Create a unified script using the command

~$ ./combish-cli build <src_name>

Will be written into "build/<src_name>.sh"

Detach

If you already have a lot of applications and wanted to have a focused source code for an app, you can 'detach' it.

   ~$ ./combish-cli detach <src_name>

and it will be written to "build/detach"

example

   ~$ ./combish-cli detach calpackage2remote

Script is runnable and can be integrated into other scripts by just calling its runner script (e.g. ./run_calpackage2remote.sh) and use the "built" script it echo

Grouping Scripts

Default combish-cli build output is a standalone script. In case you want to group scripts into one, like 'backups', create its corresponding modifiers in init/00 as follows:

Should be declared in init/00/<src_name>/modifiers.bash.inc

Example, for these scripts to be grouped together:

  • backup_git.sh
  • backup_redmine.sh
  • secure_backup.sh

add the respective files:

  • init/00/backup_git/modifiers.bash.inc
  • init/00/backup_redmine/modifiers.bash.inc
  • init/00/secure_backup/modifiers.bash.inc

with the value for each:

  script_group='backups'

Once each is built, you would see them written to build/backups/*.sh