dosubot[bot] commented on issue #37662: URL: https://github.com/apache/superset/issues/37662#issuecomment-3846493319
<!-- Greeting --> Hi @jerry000lin! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team. <!-- Answer --> You are correct—using backticks in echo statements like `echo "Running \`npm install\`"` in `docker/docker-frontend.sh` causes the command inside the backticks to execute immediately due to shell command substitution, so `npm install` (and `npm run prune`, if enabled) runs twice: once during the echo and again on the next line. This also captures the first command's output, making it look like there's little or no progress output from npm. This is a bug in the script's logic and not intended behavior. There are no existing tickets or documentation addressing this directly, but it has been noted by users and is present in recent code changes as well [cite](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docker/docker-frontend.sh#L30-L37) [cite](https://github.com/apache/superset/pull/29779). To fix this, replace the backticks with single or double quotes, like: ```sh echo "Running npm install" npm install ``` This will print the message and then run the command only once, as expected. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b9d48b56-8000-4b76-8848-ed1c4ddeaf57?feedback_type=other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](https://cursor.com/link/prompt?text=You%20are%20correct%E2%80%94using%20backticks%20in%20echo%20statements%20like%20%60echo%20%22Running%20%5C%60npm%20install%5C%60%22%60%20in%20%60docker/docker-frontend.sh%60%20causes%20the%20command%20inside%20the%20backticks%20to%20execute%20immediately%20due%20to%20shell%20command%20substitution%2C%20so%20%60npm%20install%60%20%28and%20%60npm%20run%20prune%60%2C%20if%20enabled%29%20runs%20twice%3A%20once%20during%20the%20echo%20and%20again%20on%20the%20next%20line.%20This%20also%20captures%20the%20first%20command%27s%20output%2C%20making%20it%20look%20like%20there%27s%20little%20or%20no%20progress%20output%20from%20npm.%0A%0AThis%20is%20a%20bug%20in%20the%20script%27s%20logic%20and%20not%20intended%20behavior.%20There%20are%20no%20existing%20tick ets%20or%20documentation%20addressing%20this%20directly%2C%20but%20it%20has%20been%20noted%20by%20users%20and%20is%20present%20in%20recent%20code%20changes%20as%20well%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/docker/docker-frontend.sh%23L30-L37%29%C2%A0%5Bcite%5D%28https%3A//github.com/apache/superset/pull/29779%29.%0A%0ATo%20fix%20this%2C%20replace%20the%20backticks%20with%20single%20or%20double%20quotes%2C%20like%3A%0A%60%60%60sh%0Aecho%20%22Running%20npm%20install%22%0Anpm%20install%0A%60%60%60%0AThis%20will%20print%20the%20message%20and%20then%20run%20the%20command%20only%20once%2C%20as%20expected.) [](https://go.dosu.dev/discord-bot) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset /issues/37662) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
