From 392d3c59ce2bf0276df319bae694ffb9ae2b22b3 Mon Sep 17 00:00:00 2001 From: casjay Date: Wed, 4 Sep 2024 08:53:20 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rootfs/usr/local/bin/copy rootfs/usr/local/bin/symlink --- rootfs/usr/local/bin/copy | 3 ++- rootfs/usr/local/bin/symlink | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/rootfs/usr/local/bin/copy b/rootfs/usr/local/bin/copy index 537a2ff..8227966 100755 --- a/rootfs/usr/local/bin/copy +++ b/rootfs/usr/local/bin/copy @@ -55,7 +55,8 @@ COPY_EXIT_STATUS=0 # Main application { [ $# -eq 2 ] || [ "$1" = "--help" ]; } || { __printf_color "Usage: $APPNAME fromFile toFile" && exit 1; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if [ "$1" != "$2" ]; then +is_link="$(ls -la "$2" 2>/dev/null | awk '{print $NF}')" +if [ "$1" != "$is_link" ]; then if [ -d "$1" ]; then mkdir -p "$2" cp -Rf "$1/." "$2/" diff --git a/rootfs/usr/local/bin/symlink b/rootfs/usr/local/bin/symlink index cc304c0..8bfb03e 100755 --- a/rootfs/usr/local/bin/symlink +++ b/rootfs/usr/local/bin/symlink @@ -55,7 +55,8 @@ SYMLINK_EXIT_STATUS=0 # Main application { [ $# -eq 2 ] || [ "$1" = "--help" ]; } || { __printf_color "Usage: $APPNAME fromFile toFile" && exit 1; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if [ "$1" != "$2" ]; then +is_link="$(ls -la "$2" 2>/dev/null | awk '{print $NF}')" +if [ "$1" != "$is_link" ]; then if [ -L "$2" ]; then unlink "$2" elif [ -e "$2" ]; then