@@ -9,7 +9,7 @@ yellow=$(tput setaf 3)
9
9
green=$( tput setaf 2)
10
10
reset=$( tput sgr0)
11
11
bold=$( tput bold)
12
- pythagora_dir=" pythagora "
12
+ pythagora_dir=" $1 "
13
13
14
14
function exit_handler {
15
15
while [ ! -f " ./.pythagora/finishingup" ]
@@ -25,26 +25,6 @@ function exit_handler {
25
25
exit 0
26
26
}
27
27
28
- commands=(basename realpath dirname)
29
- found_all=true
30
-
31
- for cmd in " ${commands[@]} " ; do
32
- if ! command -v " $cmd " > /dev/null 2>&1 ; then
33
- echo " $cmd command not found"
34
- found_all=false
35
- fi
36
- done
37
-
38
- if [ " $found_all " = true ] ;
39
- then
40
- pythagora_dir=$( basename " $( dirname " $( dirname " $( dirname " $( realpath " $0 " ) " ) " ) " ) " )
41
- fi
42
-
43
- if [ " $pythagora_dir " == " pythagora-dev" ]
44
- then
45
- pythagora_dir=" @pythagora.io/pythagora-dev"
46
- fi
47
-
48
28
for (( i= 0 ; i< ${# args[@]} ; i++ ))
49
29
do
50
30
if [[ " ${args[$i]} " =~ ^--init[-_]command$ ]]
71
51
exit 0
72
52
elif [[ " ${args[$i]} " == " --review" ]]
73
53
then
74
- PYTHAGORA_CONFIG=" $@ " node " ./node_modules/ ${pythagora_dir} /src/scripts/review.js"
54
+ PYTHAGORA_CONFIG=" $@ " node " ${pythagora_dir} /src/scripts/review.js"
75
55
exit 0
76
56
elif [[ " ${args[$i]} " == " --tests-eligible-for-export" ]]
77
57
then
78
58
echo " ${yellow}${bold} Tests eligible for export:${reset} "
79
- PYTHAGORA_CONFIG=" $@ " node " ./node_modules/ ${pythagora_dir} /src/scripts/testsEligibleForExport.js"
59
+ PYTHAGORA_CONFIG=" $@ " node " ${pythagora_dir} /src/scripts/testsEligibleForExport.js"
80
60
exit 0
81
61
elif [[ " ${args[$i]} " == " --unit-tests" ]]
82
62
then
83
63
echo " ${green}${bold} Generating unit tests...${reset} "
84
- PYTHAGORA_CONFIG=" $@ " node " ./node_modules/ ${pythagora_dir} /src/scripts/unit.js"
64
+ PYTHAGORA_CONFIG=" $@ " node " ${pythagora_dir} /src/scripts/unit.js"
85
65
exit 0
86
66
elif [[ " ${args[$i]} " == " --export-setup" ]]
87
67
then
88
- PYTHAGORA_CONFIG=" $@ " node " ./node_modules/ ${pythagora_dir} /src/scripts/enterData.js"
68
+ PYTHAGORA_CONFIG=" $@ " node " ${pythagora_dir} /src/scripts/enterData.js"
89
69
exit 0
90
70
elif [[ " ${args[$i]} " =~ ^--rename[-_]tests$ ]]
91
71
then
92
- node " ./node_modules/ ${pythagora_dir} /src/scripts/renameTests.js"
72
+ node " ${pythagora_dir} /src/scripts/renameTests.js"
93
73
exit 0
94
74
elif [[ " ${args[$i]} " =~ ^--delete[-_]all[-_]failed$ ]]
95
75
then
96
- node " ./node_modules/ ${pythagora_dir} /src/scripts/deleteAllFailed.js"
76
+ node " ${pythagora_dir} /src/scripts/deleteAllFailed.js"
97
77
exit 0
98
78
elif [[ " ${args[$i]} " == " --delete" ]]
99
79
then
100
- PYTHAGORA_CONFIG=" $@ " node " ./node_modules/ ${pythagora_dir} /src/scripts/deleteTest.js"
80
+ PYTHAGORA_CONFIG=" $@ " node " ${pythagora_dir} /src/scripts/deleteTest.js"
101
81
exit 0
102
82
elif [[ " ${args[$i]} " == " --export" ]]
103
83
then
104
- PYTHAGORA_CONFIG=" $@ " node -e " require('./node_modules/ ${pythagora_dir} /src/commands/export.js').runExport()"
84
+ PYTHAGORA_CONFIG=" $@ " node -e " require('${pythagora_dir} /src/commands/export.js').runExport()"
105
85
exit 0
106
86
elif [[ " ${args[$i]} " == " --mode" ]]
107
87
then
118
98
if [[ " ${args[@]} " =~ " --no-code-coverage " ]] || ([[ ! " ${args[@]} " =~ " --mode test " ]] && [[ ! " ${args[@]} " =~ " --mode=test " ]])
119
99
then
120
100
args=( " ${args[@]// --no-code-coverage/ } " )
121
- PYTHAGORA_CONFIG=" $@ " NODE_OPTIONS=" ${inspect} --require ./node_modules/ ${pythagora_dir} /src/RunPythagora.js" $init_command &
101
+ PYTHAGORA_CONFIG=" $@ " NODE_OPTIONS=" ${inspect} --require ${pythagora_dir} /src/RunPythagora.js" $init_command &
122
102
else
123
103
nyc_args=( " --reporter=text-summary" )
124
104
@@ -129,11 +109,11 @@ else
129
109
nyc_args+=( " --report-dir=./pythagora_tests/code_coverage_report" )
130
110
fi
131
111
132
- if [ -f " ./node_modules/ $pythagora_dir /node_modules/nyc/bin/nyc.js" ]
112
+ if [ -f " $pythagora_dir /node_modules/nyc/bin/nyc.js" ]
133
113
then
134
- PYTHAGORA_CONFIG=" $@ " NODE_OPTIONS=" ${inspect} --require ./node_modules/ ${pythagora_dir} /src/RunPythagora.js" ./node_modules/ " $pythagora_dir " /node_modules/nyc/bin/nyc.js " ${nyc_args[@]} " $init_command &
114
+ PYTHAGORA_CONFIG=" $@ " NODE_OPTIONS=" ${inspect} --require ${pythagora_dir} /src/RunPythagora.js" " $pythagora_dir " /node_modules/nyc/bin/nyc.js " ${nyc_args[@]} " $init_command &
135
115
else
136
- PYTHAGORA_CONFIG=" $@ " NODE_OPTIONS=" ${inspect} --require ./node_modules/ ${pythagora_dir} /src/RunPythagora.js" ./node_modules/nyc/bin/nyc.js " ${nyc_args[@]} " $init_command &
116
+ PYTHAGORA_CONFIG=" $@ " NODE_OPTIONS=" ${inspect} --require ${pythagora_dir} /src/RunPythagora.js" ./node_modules/nyc/bin/nyc.js " ${nyc_args[@]} " $init_command &
137
117
fi
138
118
139
119
fi
0 commit comments