This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +2282
-0
lines changed
Expand file tree Collapse file tree 5 files changed +2282
-0
lines changed Original file line number Diff line number Diff line change 44.DS_Store
55npm-debug.log
66* ~
7+ * .pyc
Original file line number Diff line number Diff line change 3131 export npm_config_node_gyp=" $maybe_node_gyp_path "
3232fi
3333
34+ export PYTHON=" ${binDir} /python-interceptor.sh"
35+
3436builtin cd " $initialCwd "
3537" $binDir /$nodeBin " " $binDir /../lib/cli.js" " $@ "
Original file line number Diff line number Diff line change 22SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
33export PATH=" $SCRIPT_DIR :$PATH "
44
5+ export PYTHON=" ${SCRIPT_DIR} /python-interceptor.sh"
6+
57maybe_node_gyp_path=" $SCRIPT_DIR " /../node_modules/.bin/node-gyp
68if [ -e " $maybe_node_gyp_path " ]
79then
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
4+
5+ printf " Invoked with: " >> ${HOME} /interceptor.log
6+ printf ' [%s] | ' " ${@ } " >> ${HOME} /interceptor.log
7+ printf ' \n' >> ${HOME} /interceptor.log
8+
9+ case $1 in
10+ * /gyp_main.py)
11+ GENERATOR_DIR=$( mktemp -d 2> /dev/null || mktemp -d -t ' generator' )
12+ trap " rm -r ${GENERATOR_DIR} " EXIT
13+ FORMAT_PY=" ${GENERATOR_DIR} /safemake.py"
14+ cp " ${SCRIPT_DIR} /../src/generator/safemake.py" " ${FORMAT_PY} "
15+
16+ ARGS=()
17+ FORMAT_ARG_ADDED=" no"
18+ while [ $# -gt 0 ]; do
19+ case " ${1} " in
20+ -f=* |--format=* )
21+ if [ " ${FORMAT_ARG_ADDED} " = " no" ]; then
22+ ARGS+=(" --format" " ${FORMAT_PY} " )
23+ FORMAT_ARG_ADDED=" yes"
24+ fi
25+ ;;
26+ -f|--format)
27+ shift
28+ if [ " ${FORMAT_ARG_ADDED} " = " no" ]; then
29+ ARGS+=(" --format" " ${FORMAT_PY} " )
30+ FORMAT_ARG_ADDED=" yes"
31+ fi
32+ ;;
33+ * )
34+ ARGS+=(" $1 " )
35+ ;;
36+ esac
37+ shift
38+ done
39+
40+ if [ " ${FORMAT_ARG_ADDED} " = " no" ]; then
41+ ARGS+=(" --format=${FORMAT_PY} " )
42+ fi
43+
44+ printf " exec python with: " >> ${HOME} /interceptor.log
45+ printf ' [%s] | ' " ${ARGS[@]} " >> ${HOME} /interceptor.log
46+ printf ' \n' >> ${HOME} /interceptor.log
47+
48+ python " ${ARGS[@]} "
49+ ;;
50+ * )
51+ printf " passthrough unmodified\n" >> ${HOME} /interceptor.log
52+ exec python " $@ "
53+ ;;
54+ esac
You can’t perform that action at this time.
0 commit comments