コード例 #1
0
 def install(self):
     """Install dependencies."""
     install_command = 'nvm install'
     process = subprocess.Popen(install_command,
                                **self.subprocess_args(shell=True))
     code = process.wait()
     if not code:
         use_command = 'nvm use'
         process = subprocess.Popen(use_command,
                                    **self.subprocess_args(shell=True))
         code = process.wait()
         if not code:
             return
         raise base_installer.InstallError(
             'There was an error running `{}`.'.format(use_command))
     raise base_installer.InstallError(
         'There was an error running `{}`.'.format(install_command))
コード例 #2
0
 def _install_yarn(self):
     """Install dependencies using npm."""
     install_command = 'yarn install'
     process = subprocess.Popen(install_command,
                                **self.subprocess_args(shell=True))
     code = process.wait()
     if not code:
         return
     raise base_installer.InstallError(
         'There was an error running `yarn install`.')
コード例 #3
0
 def _install_yarn(self):
     """Install dependencies using npm."""
     install_command = 'yarn install'
     process = subprocess.Popen(install_command,
                                **self.subprocess_args(shell=True))
     code = process.wait()
     if not code:
         self.pod.write_file(INSTALL_HASH_FILE, self._generate_hashes())
         return
     raise base_installer.InstallError(
         'There was an error running `yarn install`.')
コード例 #4
0
ファイル: gerrit_installer.py プロジェクト: cdhermann/grow
 def install(self):
     """Install dependencies."""
     curl_command = (
         'curl -sLo '
         '`git rev-parse --git-dir`/hooks/commit-msg '
         'https://gerrit-review.googlesource.com/tools/hooks/commit-msg')
     process = subprocess.Popen(curl_command,
                                **self.subprocess_args(shell=True))
     code = process.wait()
     if not code:
         chmod_command = 'chmod +x `git rev-parse --git-dir`/hooks/commit-msg'
         process = subprocess.Popen(chmod_command,
                                    **self.subprocess_args(shell=True))
         code = process.wait()
         if not code:
             return
         raise base_installer.InstallError(
             'There was an error running `{}`.'.format(chmod_command))
     raise base_installer.InstallError(
         'There was an error running `{}`.'.format(curl_command))
コード例 #5
0
 def install(self):
     """Install dependencies."""
     extensions_dir = self.pod.extensions_dir
     init_file_name = '/{}/__init__.py'.format(extensions_dir)
     if not self.pod.file_exists(init_file_name):
         self.pod.write_file(init_file_name, '')
     install_command = 'pip install -U -t {} -r extensions.txt'.format(
         extensions_dir)
     process = subprocess.Popen(install_command,
                                **self.subprocess_args(shell=True))
     code = process.wait()
     if not code:
         return
     raise base_installer.InstallError(
         'There was an error running `{}`.'.format(install_command))
コード例 #6
0
 def install(self):
     """Install dependencies."""
     extensions_dir = self.pod.extensions_dir
     init_file_name = '/{}/__init__.py'.format(extensions_dir)
     if not self.pod.file_exists(init_file_name):
         self.pod.write_file(init_file_name, '')
     install_command = 'pip3 install -U -q -t {} -r {}'.format(
         extensions_dir, self.pod.FILE_EXTENSIONS)
     process = subprocess.Popen(install_command,
                                **self.subprocess_args(shell=True))
     code = process.wait()
     if not code:
         self.pod.write_file(self.install_hash_filename,
                             self._generate_hashes())
         return
     raise base_installer.InstallError(
         'There was an error running `{}`.'.format(install_command))