cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit 4c48d5e4de4b5d73919370b1e87fc2b32f876a02
parent 1ae0ad780118ef1772643c2261825059baf52d64
Author: Cem Keylan <cem@ckyln.com>
Date:   Mon, 25 May 2020 02:05:46 +0300

fix kinstall function

Diffstat:
Mdoc/functions.txt | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/doc/functions.txt b/doc/functions.txt @@ -80,13 +80,11 @@ single file where it will be named as the argument. kinstall() { # usage: kinstall 755 /usr/bin/file filename - mod=$1 target=$2; mkdir -p "${target%/*}" - shift 2 - ! [ -d "$target" ] || { + ! [ -d "$2" ] || { printf '%s\n' "Error: $target is a directory" >&2 return 1 } - cp "$file" "$target" - chmod "$mod" "$target" + mkdir -p "${2%/*}"; cp "$3" "$2" + chmod "$1" "$2" }