Sha256: d79091c190ac0cae67ecf79e45a997652a0a685d2f167a70f89a59fa1d4ca1e2

Contents?: true

Size: 970 Bytes

Versions: 5

Compression:

Stored size: 970 Bytes

Contents

#!/bin/bash

#/ NAME
#/     free_sample -- template for a meaty script
#/
#/ SYNOPSIS
#/     free_sample script_name

# figure out the project root under which bin, lib live
shome="$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)"

# load a meat library
source "$shome/bin/_prime" "$@"

# entry point
function main {
  local nm_script="$1"; shift

  tmp_script="$(mktemp -t XXXXXXXXX)"
  cat "$shome/bin/$(basename "$0")" | sed "s#free_sample#$nm_script#" > "$tmp_script"
  mv "$tmp_script" "$shome/bin/$nm_script.new"
  chmod 755 "$shome/bin/$nm_script.new"
  mv "$shome/bin/$nm_script.new" "$shome/bin/$nm_script"
}

# define command line options:
#   var name, default, description, short option
DEFINE_string 'name' '' 'generate script name' '-n'

# parse the command-line
parse_command_line "$@" || exit $?
eval set -- "${FLAGS_ARGV}"

if [[ "$#" = 0 ]]; then
  logger_fatal "missing script name"
  display_help
  exit 1
fi

# pass arguments to entry point
main "$@"

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
HeSYINUvSBZfxqA-capistrano-2.5.28 bin/free_sample
HeSYINUvSBZfxqA-capistrano-2.5.27 bin/free_sample
HeSYINUvSBZfxqA-capistrano-2.5.26 bin/free_sample
HeSYINUvSBZfxqA-capistrano-2.5.25 bin/free_sample
HeSYINUvSBZfxqA-capistrano-2.5.24 bin/free_sample