forked from taborlab/FlowCal
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRun FlowCal (macOS)
executable file
·29 lines (24 loc) · 1.21 KB
/
Run FlowCal (macOS)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Run FlowCal using Python. The Python version should be the one installed by
# Anaconda. As with the `Install FlowCal (macOS)` script, look up the current
# default shell, run it as an interactive login shell with a clean
# environment, and use it to run the FlowCal Excel UI.
# Look up default shell for current user using the directory service command
# line utility (dscl).
default_shell="$(dscl . -read Users/$(whoami) UserShell \
| sed 's/UserShell: //')"
# Commands that run FlowCal. (Commands are collected via a here document,
# which is input to a `tr` command that removes the newline characters.) The
# export command changes the default matplotlib backend, which is necessary
# to properly show the open file dialog.
run_flowcal="$(tr -d '\012' <<END
export MPLBACKEND='TkAgg';
python -m FlowCal.excel_ui -v -p -H;
END
)"
# Run commands in the default shell run as an interactive ("-i") login ("-l")
# shell with a clean environment ("env -i", so the PATH variable is not
# inherited from this shell and mangled). (Getting zsh to source .zshrc
# requires an interactive shell; getting bash to source .bash_profile
# requires a login shell.)
env -i $default_shell -i -l -c "${run_flowcal}"