From f75d416abe1fc761cbb07ccd6a2c5da82e07d487 Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Mon, 4 Jul 2022 23:14:58 +0200 Subject: [PATCH] fix(handlers): use args rather than stdin --- handlers/deb/install | 3 +-- handlers/make/install | 3 +-- handlers/script/install | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/handlers/deb/install b/handlers/deb/install index c0732dd..96c3f3e 100755 --- a/handlers/deb/install +++ b/handlers/deb/install @@ -1,8 +1,7 @@ #!/bin/sh # Install a package from a local or downloaded .deb-file and remove it loc="/tmp/install.deb" -arg="$(read)" -case "$arg" in +case "$1" in (http*) sudo wget -O "$loc" "$arg";; (*) loc="$arg";; esac diff --git a/handlers/make/install b/handlers/make/install index 1cfaac6..fd10e31 100755 --- a/handlers/make/install +++ b/handlers/make/install @@ -1,4 +1,3 @@ #!/usr/bin/env sh -arg="$(read)" -cd "$arg" +cd "$1" sudo checkinstall diff --git a/handlers/script/install b/handlers/script/install index 30ba62b..b39ce08 100755 --- a/handlers/script/install +++ b/handlers/script/install @@ -1,6 +1,6 @@ #!/bin/sh -read arg -read name +arg=$1 +name=$2 location="/usr/local/bin/${name:-$(basename "$arg")}" curl "$arg" | sudo tee "$location" > /dev/null sudo chmod +x "$location"