Clion hangs on my custom pre-launch script
Answered
Hi,
I want to "target install" before launching my executable but since install DIR is in my system directory, I came up with this script so that "target install" has root permission to succeed.
#!/bin/bash -e
SRC_DIR=$(readlink -f $0 | xargs dirname)
echo MY_PASSWORD | sudo -S make -C ${SRC_DIR}/../cmake-build-debug/cgi install
The issue is pre-launch build hangs and never returns in CLion. How can I correct this ?
Please sign in to leave a comment.
Hello!
It seems for now the only way to "target install" is to launch CLion as root. Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-16849 in order to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
The issue is my script works if I run it by myself outside of Clion. Running it as pre launch script inside Clion hangs and I don't know why. Maybe the way I am feeding my password to the sudo command and that breaks Clion ?
How do you run your script? Using an External tool? If yes, please try running this external tool in CLion separately (https://www.jetbrains.com/help/clion/configuring-third-party-tools.html#run-local-external-tool), not as a pre-build step. Does it work?