Sha256: c0d1efb77019ec67f316ddca79790572d7445aebb88efcde5d3c2573730a096d

Contents?: true

Size: 814 Bytes

Versions: 12

Compression:

Stored size: 814 Bytes

Contents

#!/bin/bash

#/ NAME
#/     stub-prepare -- prepares a new stub
#/
#/ SYNOPSIS
#/     stub prepare <new_command>

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

# load a jason bourne library
source "$shome/bin/_treadstone"

# parse the command-line

# entry point
function main {
  if [[ "$#" = 0 ]]; then
    logger_fatal "missing new command name"
    exit 1
  fi

  local dollar='$'
  local nm_command="$1"; shift

  ln -vs stub "$shome/bin/$nm_command"
  cat > "$shome/libexec/$nm_command" << EOF
    echo arguments are ${dollar}@"
EOF
  chmod 755 "$shome/libexec/$nm_command"

  logger_info "$nm_command is stubbed at bin/$nm_command"
  logger_info "edit libexec/$nm_command for the actual script"
}

require 'sub' "$BASH_SOURCE" "$@"

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
alpha_omega-1.2.1 libexec/stub-prepare
boxcar-0.10005.1 libexec/stub-prepare
alpha_omega-1.2.0 libexec/stub-prepare
alpha_omega-1.1.11 libexec/stub-prepare
alpha_omega-1.1.10 libexec/stub-prepare
alpha_omega-1.1.9 libexec/stub-prepare
alpha_omega-1.1.7 libexec/stub-prepare
alpha_omega-1.1.6 libexec/stub-prepare
alpha_omega-1.1.5 libexec/stub-prepare
alpha_omega-1.1.4 libexec/stub-prepare
alpha_omega-1.1.3 libexec/stub-prepare
alpha_omega-1.1.1 libexec/stub-prepare