summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Carr2016-03-27 02:55:40 -0700
committerDonald Carr2016-03-27 02:59:50 -0700
commit00d55b196a5d534f86316a786cc4437a25fac013 (patch)
tree03957cc7411f792fcdb33c92611fe898f8af7700
parent40ceb0b45f2c284e726ce5a97bc2f3ddfd45d6f7 (diff)
downloadaur-00d55b196a5d534f86316a786cc4437a25fac013.tar.gz
Adjust qtcreator -client binary name (changed in 4)
Change-Id: Iaff588069aa17c81d293022040f0a376fcd733c9
-rwxr-xr-xqtc18
1 files changed, 14 insertions, 4 deletions
diff --git a/qtc b/qtc
index 93c5d24c2475..274ad5a13869 100755
--- a/qtc
+++ b/qtc
@@ -1,19 +1,29 @@
#!/usr/bin/env bash
+#set -x
+
+qtcreator_bin=qtcreator
+
if [[ "$(uname -s)" = "Darwin" ]]; then
open -a "Qt Creator" $@
else
- pid=$(pidof qtcreator-bin)
+ # As of Qt Creator 4
+ pid=$(pidof $qtcreator_bin)
+ if [[ "${pid}" = "" ]]; then
+ # Check for legacy versions
+ qtcreator_bin=qtcreator-bin
+ pid=$(pidof $qtcreator_bin)
+ fi
# find existing creator instance
if [[ "${pid}" != "" ]]; then
- creatorbin=$(ls -l /proc/${pid}/exe | awk '{ print $11 }')
- ${creatorbin} -client $@
+ resident_qtcreator_bin=$(ls -l /proc/${pid}/exe | awk '{ print $11 }')
+ ${resident_qtcreator_bin} -client $@
exit 0
fi
# failing that run the creator in your path
- qtcreator $@
+ $qtcreator_bin $@
fi
exit 0