#!/bin/bash
# Generate a list of symlinked files and directories.
# Each line must be the file path, relative to the git root.

WDir="${PWD##*/}"
[[ $WDir == 'scripts' ]] && cd ..

dst='nikola/data/symlinked.txt'
git ls-files -s | awk '/120000/{print $4}' > $dst

#!/bin/bash
# Generate a list of symlinked files and directories.
# Each line must be the file path, relative to the git root.

WDir="${PWD##*/}"
[[ $WDir == 'scripts' ]] && cd ..

dst='nikola/data/symlinked.txt'

# Remove stale symlinks
for f in $(git ls-files -s | awk '/120000/{print $4}'); do
    if [[ ! -e $f ]]; then
        git rm -f $f
    fi
done

git ls-files -s | awk '/120000/{print $4}' > $dst

Clean up stale symlinks when creating symlinked list
Clean up stale symlinks when creating symlinked list [ci skip]

Signed-off-by: Chris Warrick <de6f931166e131a07f31c96c765aee08f061d1a5@gmail.com>
