diff options
-rwxr-xr-x | nuttx/tools/link.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nuttx/tools/link.sh b/nuttx/tools/link.sh index da1e6e7ae..f14e9e5ab 100755 --- a/nuttx/tools/link.sh +++ b/nuttx/tools/link.sh @@ -51,6 +51,15 @@ fi # report that it does not exist. if [ -h "${dest}" ]; then + + # If the link is already created (and matches the request) do nothing + + if [ "$(readlink ${dest})" = "${src}" ]; then + exit 0 + fi + + # Otherwise, remove the link + rm -f "${dest}" else |