From 5ef5127f1be9a24eb5a2d659be8359e9635e7a8d Mon Sep 17 00:00:00 2001 From: Gaetan Jonathan BAKARY Date: Mon, 30 Sep 2024 22:26:40 +0300 Subject: [PATCH 1/2] Update install.sh who the hell said you could create a symbolic link on a file located in /usr/ with a simple user under Linux? even if I run the script with sudo, the installation directory becomes /root/.fvm, not for my user, bug I'll get a permission error afterwards --- scripts/install.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 69aec862..e90cd3f4 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -105,7 +105,15 @@ fi # Create a symlink if ! ln -sf "$FMV_DIR_BIN/fvm" "$SYMLINK_TARGET"; then - error "Failed to create symlink." + # verify if linux and try with sudo + if [[ "$(uname)" == "Linux" ]]; then + echo -e "Trying to create symlink with sudo..." + if ! sudo ln -sf "$FMV_DIR_BIN/fvm" "$SYMLINK_TARGET"; then + error "Failed to create symlink" + fi + else + error "Failed to create symlink" + fi fi # Verify installation From 884c74536b0cc1b28488ac575389668f75727428 Mon Sep 17 00:00:00 2001 From: Gaetan Jonathan BAKARY Date: Mon, 30 Sep 2024 23:12:50 +0300 Subject: [PATCH 2/2] Update install.sh --- scripts/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index e90cd3f4..5ce5c2a8 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -106,7 +106,7 @@ fi # Create a symlink if ! ln -sf "$FMV_DIR_BIN/fvm" "$SYMLINK_TARGET"; then # verify if linux and try with sudo - if [[ "$(uname)" == "Linux" ]]; then + if [ "$OS" == "linux" ]; then echo -e "Trying to create symlink with sudo..." if ! sudo ln -sf "$FMV_DIR_BIN/fvm" "$SYMLINK_TARGET"; then error "Failed to create symlink"