Merge branch 'feature-script-add-function' into develop
This commit is contained in:
commit
832decf3d1
@ -2,10 +2,12 @@
|
||||
#remaster lib
|
||||
[ -d "<LIBDIR>" ] || { echo "LIBDIR not exist"; exit 1; }
|
||||
|
||||
#beginn func
|
||||
|
||||
#<function> [param]
|
||||
function <function>() {
|
||||
#Code of <function>
|
||||
}
|
||||
|
||||
#this func is standalone executable
|
||||
[ -n "$1" ] && {
|
||||
check_user
|
||||
<function> $@
|
||||
}
|
||||
|
12
script/add_function.sh
Executable file
12
script/add_function.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
#check param
|
||||
[ -z "$1" ] && { echo "$0 [name]"; exit 1; }
|
||||
name="$1"
|
||||
|
||||
#gen function
|
||||
cp "doc/lib-head+tail" "src/func/$name"
|
||||
sed -i "s/<function>/$name/g" "src/func/$name"
|
||||
|
||||
#open
|
||||
editor "src/func/$name"
|
Loading…
Reference in New Issue
Block a user