message: eoscpp bugfix
diff: #!/bin/bash -e
  function copy_skeleton {
  - cp -r /home/ubuntu/eos/contracts/skeleton/. $newname
  + cp -r @CMAKE_SOURCE_DIR@/contracts/skeleton/. $newname
  for file in $(find ./$newname -name 'skeleton.*')
  do
  @@ -11,9 +11,6 @@ function copy_skeleton {
  }
  function build_contract {
  - output=$1
  - shift
  -
  workdir=`mktemp -d`
  mkdir $workdir/built
  @@ -26,41 +23,43 @@ function build_contract {
  @WASM_LLVM_LINK@ -o $workdir/linked.bc $workdir/built/*
  @WASM_LLC@ --asm-verbose=false -o $workdir/assembly.s $workdir/linked.bc
  - @BINARYEN_BIN@/s2wasm -o $output -s 16384 $workdir/assembly.s
  + @BINARYEN_BIN@/s2wasm -o $outname -s 16384 $workdir/assembly.s
  rm -rf $workdir
  }
  function print_help {
  - echo "Usage: $0 output.wast contract.cpp [other.cpp ...]"
  + echo "Usage: $0 -o output.wast contract.cpp [other.cpp ...]"
  echo " OR"
  echo " $0 -n mycontract"
  echo
  echo "Options:"
  echo " -n | --newcontract [name]"
  echo " Create a new contract in the [name] folder, based on the example contract"
  + echo " OR"
  + echo " -o | --outname [output.wast] [input.cpp ...]"
  + echo " Generate the wast output file based on input cpp files"
  }
  -OPTIONS=$(getopt --options=hn: --longoptions=help,newcontract: --name "$0" -- "$@")
  -if [[ $? -ne 0 ]]; then
  - # getopt failed
  - exit 2
  -fi
  +command=""
  -eval set -- "$OPTIONS"
  +while [[ $# -gt 1 ]]
  +do
  +key="$1"
  -while true; do
  - case "$1" in
  +case $key in
  -n|--newcontract)
  - newname=$2
  + newname="$2"
  + command="newcontract"
  shift 2
  ;;
  -h|--help)
  print_help
  - exit 1
  ;;
  - --)
  - shift
  + -o|--outname)
  + outname="$2"
  + command="outname"
  + shift 2
  break
  ;;
  *)
  @@ -70,16 +69,13 @@ while true; do
  esac
  done
  -if [[ "x" == "x$newname" ]]; then
  - if [[ $# -le 1 ]]; then
  - print_help
  - exit 1
  - fi
  +if [[ "outname" == "$command" ]]; then
  build_contract $@
  else
  - if [[ $# -ne 0 ]]; then
  + if [[ "newcontract" == "$command" ]]; then
  + copy_skeleton
  + else
  print_help
  exit 1
  fi
  - copy_skeleton $newname
  fi
  