Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Unified Diff: tools-webrtc/android/profiling/perf_setup.sh

Issue 2724963005: Fix perf_setup.sh for zsh. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools-webrtc/android/profiling/perf_setup.sh
diff --git a/tools-webrtc/android/profiling/perf_setup.sh b/tools-webrtc/android/profiling/perf_setup.sh
index 9d80e4158afb1175208375a693f354082940e175..810c4860896c55a8f12922edc6ccbbff95eceb31 100755
--- a/tools-webrtc/android/profiling/perf_setup.sh
+++ b/tools-webrtc/android/profiling/perf_setup.sh
@@ -32,7 +32,14 @@
# > plot_flame_graph
# > perf_cleanup
-SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
+if [ -n "$ZSH_VERSION" ]; then
+ # Running inside zsh.
+ SCRIPT_PATH="${(%):-%N}"
henrika_webrtc 2017/03/02 17:20:56 I can't say how that works but I trust you :-)
+else
+ # Running inside something else (most likely bash).
+ SCRIPT_PATH="${BASH_SOURCE[0]}"
+fi
+SCRIPT_DIR="$(cd $(dirname "$SCRIPT_PATH") && pwd -P)"
source "${SCRIPT_DIR}/utilities.sh"
# Root directory for local symbol cache.
@@ -96,7 +103,7 @@ function arch_is_ok() {
# which is used by simpleperf as base when searching for symbols.
function copy_native_shared_library_to_symbol_cache() {
local arm_lib="arm"
- if [ "$(native_shared_lib_arch)" == "AArch64" ]; then
+ if [[ "$(native_shared_lib_arch)" == "AArch64" ]]; then
arm_lib="arm64"
fi
for num in 1 2; do
@@ -355,7 +362,7 @@ main() {
ok "adb tool is working"
# Exactly one Android device must be connected.
- if [[ ! one_device_connected ]]; then
+ if ! one_device_connected; then
error "one device must be connected"
return 1
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698