aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-05-24 23:05:45 +0000
committermerakor <cem@ckyln.com>2020-05-24 23:05:45 +0000
commit6295a9e619865ddd677c8677fce8cc2b405c9450 (patch)
tree5104d540a6178bafff97e6e4f0424d18c07a398c
parentf2a193c68e06df23f6c57e6f90aa7cad79421949 (diff)
downloadcpt-6295a9e619865ddd677c8677fce8cc2b405c9450.tar.gz
fix kinstall function
FossilOrigin-Name: c7c516c066c0721159d2a2d00a5c772c369a4b68cb6a8457d61d44fbe0809af3
-rw-r--r--doc/functions.txt8
1 files changed, 3 insertions, 5 deletions
diff --git a/doc/functions.txt b/doc/functions.txt
index 965c778..0f8cd60 100644
--- 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"
}