#!/bin/sh
###########################################################################
# Copies or expands an example file to the destination.
# Usage:
#   $1: source example
#   $2: destination file
#   $3: expand example variables (true/false)
#   $4: open file in editor (true/false)
#
# Copyright (C) 2010 Alkis Georgopoulos <alkisg@gmail.com>
#
# 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 details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
# On Debian GNU/Linux systems, the complete text of the GNU General
# Public License can be found in `/usr/share/common-licenses/GPL'.
###########################################################################

# Source the sch-scripts common functions and variables.
if [ ! -f ./scripts/common/common.sh ]; then
    cd /usr/share/sch-scripts
fi
. ./scripts/common/common.sh

install_example "$1" "$2" "$3"

if is_true "$4"; then
    gedit "$2"
fi
