9
9
from subprocess import check_output
10
10
from distutils .core import Command
11
11
12
+ import sentry # We just need its path via __file__
13
+
14
+
15
+ SENTRY_ROOT_PATH = os .path .abspath (os .path .join (sentry .__file__ , '..' , '..' , '..' ))
16
+
17
+
18
+ YARN_PATH = os .path .join (SENTRY_ROOT_PATH , 'bin' , 'yarn' )
19
+
12
20
13
21
class BaseBuildCommand (Command ):
14
22
user_options = [
@@ -132,8 +140,8 @@ def _setup_js_deps(self):
132
140
133
141
if node_version [2 ] is not None :
134
142
log .info (u'using node ({0}))' .format (node_version ))
135
- self ._run_command (
136
- ['./bin/yarn' , ' install' , '--production' , '--pure-lockfile' , '--quiet' ]
143
+ self ._run_yarn_command (
144
+ ['install' , '--production' , '--pure-lockfile' , '--quiet' ]
137
145
)
138
146
139
147
def _run_command (self , cmd , env = None ):
@@ -144,6 +152,12 @@ def _run_command(self, cmd, env=None):
144
152
log .error ('command failed [%s] via [%s]' % (' ' .join (cmd ), self .work_path , ))
145
153
raise
146
154
155
+ def _run_yarn_command (self , cmd , env = None ):
156
+ log .debug (u'yarn path: ({0}))' .format (YARN_PATH ))
157
+ self ._run_command (
158
+ [YARN_PATH ] + cmd , env = env
159
+ )
160
+
147
161
def update_manifests (self ):
148
162
# if we were invoked from sdist, we need to inform sdist about
149
163
# which files we just generated. Otherwise they will be missing
0 commit comments