#!/bin/bash

baseDir="$( cd "$(dirname "$0")" && pwd )"
cd "$baseDir"

# first check what will be built

function packAll() {
  for i in ./cmds/* ; do
    if [ -e $i/pack ]; then
      $i/pack $1
    fi
  done
}

echo ""
echo "pack list:"
echo ""

packAll check

# confirm

echo ""
read -p "press [Enter] to start packing" x
echo ""

# build

set -e
packAll build

echo ""
echo "finished packing."
echo ""
