There is no need to install in the global path nor to use SUDO if the given path was writtable (#18)
* There's no need for sudo + Added warning if not in PATH * fix: removed duplicated command call --------- Co-authored-by: v4n <105587619+v4n00@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d18a9cdccf
commit
0485b56df5
+9
-3
@@ -135,11 +135,17 @@ else
|
||||
fi
|
||||
|
||||
echo "Installing $SCRIPT_NAME to $DESTINATION_PATH."
|
||||
sudo curl "$REPO_URL"/h2mm --output "$DESTINATION_PATH/$SCRIPT_NAME"
|
||||
sudo chmod +x "$DESTINATION_PATH/$SCRIPT_NAME"
|
||||
if [ -r "$DESTINATION_PATH" ]; then
|
||||
curl "$REPO_URL"/h2mm --output "$DESTINATION_PATH/$SCRIPT_NAME"
|
||||
chmod +x "$DESTINATION_PATH/$SCRIPT_NAME"
|
||||
else
|
||||
sudo curl "$REPO_URL"/h2mm --output "$DESTINATION_PATH/$SCRIPT_NAME"
|
||||
sudo chmod +x "$DESTINATION_PATH/$SCRIPT_NAME"
|
||||
fi
|
||||
|
||||
|
||||
if [[ ! -x "$(command -v $SCRIPT_NAME)" ]]; then
|
||||
echo -e "${RED}Error:${NC} Installation failed."
|
||||
echo -e "${RED}Error:${NC} Installation failed. Mod manager was not found in PATH."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user