#!/bin/sh -e

current_directory=$(pwd)
mount_from="$HOME/Projects/python-cellframe/dists/interfaces/"
mount_to="$current_directory/interfaces"

if [ ! -d "$mount_to" ]; then
  sudo mkdir "$mount_to"
  echo "Directory \"$mount_to\" not exist."
else
  echo "Directory \"$mount_to\" already exist."
fi

command_to_execute="sudo mount $mount_from $mount_to -obind"
if output=$($command_to_execute 2>&1); then
  echo "Directory \"$mount_from\" successfully mounted."
else
  exit_code=$?
  echo "An error occurred while executing the command. Return code: $exit_code"
  echo "$output"
fi
