#!/bin/bash
# -*- sh -*- Java Training Wheels installer module

### Copyright (C) 2016 Davin Pearson

### Maintainer: Davin Pearson <davin.pearson@gmail.com>
### Keywords: Java Training Wheels installer module

### This program is not part of GNU Emacs

### Commentary:

### This shell script copies the given file to certain other
### directories, if those directories exist.

### Limitation Of Warranty:

### This program is free software: you can redistribute it and/or modify
### it under the terms of the GNU General Public License as published by
### the Free Software Foundation, either version 3 of the License, or (at
### your option) any later version.
###
### This program is distributed in the hope that it will be useful,
### but WITHOUT ANY WARRANTY; without even the implied warranty of
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
### General Public License for more detail.
###
### You should have received a copy of the GNU General Public License
### along with GNU Emacs, see the file COPYING.  If not, see:
###
### <http://www.gnu.org/licenses/gpl.txt>.

DATESTAMP=$(date +"%Y%m%d-%H%M%S")
STUMP=$1

printf "STUMP=%s\n" $STUMP

if [[ -d ~/bak ]]; then
    echo "folder ~/bak exists";
    cp -fupv $STUMP*.tar.gz ~/bak
else
    echo "folder ~/bak does not exist";
fi

if [[ -d ~/hairy-lemon/output/davinpearson-com/binaries ]]; then
    echo "folder ~/hairy-lemon/output/davinpearson-com/binaries exists";
    cp -fupv $STUMP*.tar.gz ~/hairy-lemon/output/davinpearson-com/binaries
else
    echo "folder ~/hairy-lemon/output/davinpearson-com/binaries does not exist";
fi

rm -fv $STUMP*.tar.gz


