diff options
| author | wbc6080 <wangbincheng4@huawei.com> | 2023-11-30 14:40:03 +0800 |
|---|---|---|
| committer | wbc6080 <wangbincheng4@huawei.com> | 2023-11-30 14:40:03 +0800 |
| commit | 281471f6f67a271d2ddc55d6eab00fc45c74a5bf (patch) | |
| tree | 5dcc82806d3a8a62e5bed1ef903d75c6d5a1d674 /staging/src/github.com | |
| parent | Merge pull request #5222 from lishaokai1995/master (diff) | |
| download | kubeedge-281471f6f67a271d2ddc55d6eab00fc45c74a5bf.tar.gz | |
update generate.sh in mapper-framework
Signed-off-by: wbc6080 <wangbincheng4@huawei.com>
Diffstat (limited to 'staging/src/github.com')
| -rwxr-xr-x | staging/src/github.com/kubeedge/mapper-framework/hack/make-rules/generate.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/staging/src/github.com/kubeedge/mapper-framework/hack/make-rules/generate.sh b/staging/src/github.com/kubeedge/mapper-framework/hack/make-rules/generate.sh index 7003f4c7b..7d955ec58 100755 --- a/staging/src/github.com/kubeedge/mapper-framework/hack/make-rules/generate.sh +++ b/staging/src/github.com/kubeedge/mapper-framework/hack/make-rules/generate.sh @@ -11,10 +11,14 @@ MAPPER_DIR="$(cd "$(dirname "$ROOT_DIR")" && pwd -P)" function entry() { # copy template - read -p "Please input the mapper name (like 'Bluetooth', 'BLE'): " -r mapperName - if [[ -z "${mapperName}" ]]; then - echo "the mapper name is required" - exit 1 + if [ $# -eq 0 ] ;then + read -p "Please input the mapper name (like 'Bluetooth', 'BLE'): " -r mapperName + if [[ -z "${mapperName}" ]]; then + echo "the mapper name is required" + exit 1 + fi + else + mapperName=$1 fi mapperNameLowercase=$(echo -n "${mapperName}" | tr '[:upper:]' '[:lower:]') mapperPath="${MAPPER_DIR}/${mapperNameLowercase}" |
