forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunPythonEmacs
More file actions
executable file
·42 lines (33 loc) · 1.62 KB
/
runPythonEmacs
File metadata and controls
executable file
·42 lines (33 loc) · 1.62 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /bin/bash
# This script is designed to de-Cygwinify the project variables set by
# the ctattach scripts. If you aren't using ctattach (and you almost
# certainly won't be, unless you're a member of the VR Studio),
# there's no reason to use this script.
# First, de-Cygwinify the HOME variable. Since this variable is
# hardcoded, we can just do it.
HOME=`cygpath -w $HOME`
export HOME
# Now de-Cygwinify the package variables for all of the trees we are
# attached to, e.g. $DTOOL, $PANDA, $DIRECT, etc. These variable
# names are discovered by parsing the $CTPROJS variable, which is made
# up of a series of words like "DIRECT:personal PANDA:personal
# DTOOL:install"; we simply pull off each word and get the part
# preceding the colon.
# That gives us an indirect reference: we end up with a variable that
# contains, e.g., the string "DTOOL": the name of the variable we want
# to modify. Bash provides a way to read the value of an indirect
# reference: ${!varname} returns the variable named by the contents of
# $varname.
# However, bash doesn't provide a way to set the variable named by an
# indirect reference. But we can achieve this by using the env
# command, which accepts as a parameter a list of variables that
# should be reassigned, in the form "var1=value1 var2=value2 ...". So
# we just have to build up this string and pass it to the env command.
assign=""
for packageDef in $CTPROJS; do
packageVar=`echo $packageDef | sed 's/:.*$//'`
decyg=`cygpath -w ${!packageVar}`
assign="$assign $packageVar=$decyg"
done
# Now use the env command to pass all these assignments to emacs.
exec env $assign runemacs "$@"