#!/bin/bash

if [ $# != 1 ]; then
    echo "Syntax: " $0 "destination"
    echo "install examples in destination/examples"
    exit 1
fi

if [ -d $1"/examples" ]; then
    echo "Error: " $1"/examples already exit"
    exit 1
fi

mkdir -p $1"/examples" 
cp -af ./* $1"/examples" 
rm $1"/examples/install-examples" 
find $1"/examples" -name \*.gz | xargs gunzip
find $1"/examples" -name \*.py | xargs chmod +x
