diff options
author | Donald Carr | 2016-03-27 02:55:40 -0700 |
---|---|---|
committer | Donald Carr | 2016-03-27 02:59:50 -0700 |
commit | 00d55b196a5d534f86316a786cc4437a25fac013 (patch) | |
tree | 03957cc7411f792fcdb33c92611fe898f8af7700 | |
parent | 40ceb0b45f2c284e726ce5a97bc2f3ddfd45d6f7 (diff) | |
download | aur-00d55b196a5d534f86316a786cc4437a25fac013.tar.gz |
Adjust qtcreator -client binary name (changed in 4)
Change-Id: Iaff588069aa17c81d293022040f0a376fcd733c9
-rwxr-xr-x | qtc | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -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 |