wyatt-packages/scripts/symbolic_links.sh

53 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Copyright (C) 2023 WYATT GROUP
# Please see the AUTHORS file for details.
#
# 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
# 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 <https://www.gnu.org/licenses/>.
# Script that iterates through each package in the packages directory and
# creates a symbolic link to the main .gitignore file, AUTHORS, and LICENSE
# files if they do not already exist.
# Current directory
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# Path to the packages directory
PACKAGES_DIR="$DIR/../packages"
# Iterate through each package in the packages directory
for package in "$PACKAGES_DIR"/*; do
# Go to the package directory
cd "$package"
# Create symbolic link to the main .gitignore file if it does not already
# exist
if [ ! -f .gitignore ]; then
ln -s ../../.gitignore .gitignore
fi
# Create symbolic link to the main AUTHORS file if it does not already
# exist
if [ ! -f AUTHORS ]; then
ln -s ../../AUTHORS AUTHORS
fi
# Create symbolic link to the main LICENSE file if it does not already
# exist
if [ ! -f LICENSE ]; then
ln -s ../../LICENSE LICENSE
fi
done