File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,16 @@ function initialize_target_project {
149
149
fi
150
150
151
151
(
152
- cd ${project_dir} > /dev/null 2>&1
152
+ cd ${project_dir}
153
153
154
- # install dependencies
154
+ log " installing the output project's npm dependencies... "
155
155
npm i > /dev/null 2>&1
156
- if (( $? == 1 )) ; then
157
- quit " failed installing the output project's npm dependencies"
158
- fi
156
+ status_log " installed ok" " install failed"
159
157
160
- # launch dev server / whatever
161
158
if is_npm_command_available " $init_command " ; then
162
- npm run " $init_command " > /dev/null 2>&1
163
- if (( $? == 1 )) ; then
164
- quit " the output project's initialize command execution failed"
165
- fi
159
+ log " executing the output project's npm command '$init_command ' in the background..."
160
+ npm run " $init_command " &
161
+ status_log " executed ok" " execution failed"
166
162
fi
167
163
)
168
164
}
@@ -309,6 +305,17 @@ function log {
309
305
printf " \n[dev-server] %s\n" " $msg "
310
306
}
311
307
308
+ function status_log {
309
+ local status=$?
310
+ local ok_msg=" $1 "
311
+ local err_msg=" $2 "
312
+ if (( $status == 0 )) ; then
313
+ log " $ok_msg "
314
+ else
315
+ quit " $err_msg "
316
+ fi
317
+ }
318
+
312
319
function quit {
313
320
local errMsg=" $1 "
314
321
if [[ -n " $errMsg " ]]; then
You can’t perform that action at this time.
0 commit comments