#!/bin/sh

set -e

# Source the debconf library
. /usr/share/debconf/confmodule

# Only do linking on install and configure
if [ "$1" = "install" ] || [ "$1" = "configure" ]; then
    # Check answer
    if [ ! -e /usr/bin/swift ]; then
        db_get swiftlang/link_swift
        if [ "$RET" = "true" ]; then
            #echo "Linking /usr/bin/swift to /usr/libexec/swift/bin/swift"
            ln -s /usr/libexec/swift/bin/swift /usr/bin/swift
        fi
    fi
fi

#DEBHELPER#
