From 10fb48069b6a610593f83d7e0a200dc643bddd4f Mon Sep 17 00:00:00 2001 From: "kebler.net" Date: Mon, 24 Oct 2022 18:12:33 -0700 Subject: [PATCH] add module copy module_cp to module library --- module.lib | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/module.lib b/module.lib index 7bf53f7..6747314 100644 --- a/module.lib +++ b/module.lib @@ -96,6 +96,16 @@ cat $FILE return 0 } +module_cp() { +[ ! $1 ] && echo "no module specified" && return 1 +local FILE +FILE=$(module_find $1) +[ $? -ne 0 ] && echo no module $1 found && return 1 +echo cp $FILE ${2:-$(pwd)} +cp $FILE ${2:-$(pwd)} +return 0 +} + module_loaded() { [ ! $1 ] && echo "no module specified" && return 1 local func