chore: Use 'install' instead of 'cp, chmod, mv,...'

This commit is contained in:
Serge Guzik 2019-02-15 11:32:49 +02:00
parent 19ebc90cc5
commit 4e87231b59

11
install
View File

@ -59,11 +59,12 @@ function install() {
echo "Error: Failed to download $name" >&2 echo "Error: Failed to download $name" >&2
fail fail
fi fi
echo "Installing $LOCATION/$name..." echo "Creating $LOCATION/$name..."
chmod 755 "$temp_location" && \ sudo install -D \
sudo chown root:root "$temp_location" && \ --mode=755 \
sudo mkdir -p "$LOCATION" && \ --owner=root \
sudo mv "$temp_location" "$LOCATION/$name" --group=root \
"$temp_location" "$LOCATION"
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "Error: Failed to install $name" >&2 echo "Error: Failed to install $name" >&2
fail fail