Skip to content

Commit ece3aa1

Browse files
CarlosLeeGittau233
authored andcommitted
fix template scripts
1 parent 1a2e3d4 commit ece3aa1

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

examples/bin/template

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,12 @@ create_project() {
187187
--rootpath)
188188
project_root_path="$arg_value"
189189
shift "$shift_count" ;;
190-
-- ) shift; break ;;
191-
* ) break ;;
190+
-- )
191+
echo "invalid arg -"
192+
shift ;;
193+
* )
194+
echo "invalid arg $arg_option"
195+
shift ;;
192196
esac
193197
done
194198

@@ -218,14 +222,14 @@ create_project() {
218222
}
219223

220224
create_service_plugin_template() {
221-
TEMPLATE_PATH="$MODELBOX_TEMPLATE_PATH/plugin"
225+
TEMPLATE_PATH="$MODELBOX_TEMPLATE_PATH/service-plugin"
222226
SOURCE_DIR="${project_path}/src/service-plugin/${plugin_name}"
223227
CMAKE_FILE="${SOURCE_DIR}/CMakeLists.txt"
224228
SOURCE_FILE="${SOURCE_DIR}/${plugin_name}.cc"
225229
HEAD_FILE="${SOURCE_DIR}/${plugin_name}.h"
226230

227231
if [ ! -d "$TEMPLATE_PATH" ]; then
228-
echoerr "Server plugin template not exist."
232+
echoerr "Server plugin template ${TEMPLATE_PATH} not exist."
229233
return 1
230234
fi
231235

@@ -288,11 +292,15 @@ create_service_plugin() {
288292
--name)
289293
plugin_name="$arg_value"
290294
shift "$shift_count" ;;
291-
--path)
295+
--project-path)
292296
project_path="$arg_value"
293297
shift "$shift_count" ;;
294-
-- ) shift; break ;;
295-
* ) break ;;
298+
-- )
299+
echo "invalid arg -"
300+
shift ;;
301+
* )
302+
echo "invalid arg $arg_option"
303+
shift ;;
296304
esac
297305
done
298306

0 commit comments

Comments
 (0)