Example #1
0
 def check_prerequisites(self):
     """Check if required prerequisites are installed or available."""
     status_command = 'pip --version > /dev/null 2>&1'
     not_found = subprocess.call(status_command,
                                 **self.subprocess_args(shell=True)) == 127
     if not_found:
         raise base_installer.MissingPrerequisiteError(
             'The `pip` command was not found.')
Example #2
0
 def _check_prerequisites_yarn(self):
     """Check if required prerequisites are installed or available."""
     status_command = 'yarn --version > /dev/null 2>&1'
     not_found = subprocess.call(status_command,
                                 **self.subprocess_args(shell=True)) == 127
     if not_found:
         install_commands = [
             'Install yarn from https://yarnpkg.com/en/docs/install'
         ]
         raise base_installer.MissingPrerequisiteError(
             'The `yarn` command was not found.',
             install_commands=install_commands)
Example #3
0
 def check_prerequisites(self):
     """Check if required prerequisites are installed or available."""
     status_command = 'nvm --version > /dev/null 2>&1'
     not_found = subprocess.call(status_command,
                                 **self.subprocess_args(shell=True)) == 127
     if not_found:
         install_commands = [
             'Download nvm from https://github.com/creationix/nvm'
         ]
         raise base_installer.MissingPrerequisiteError(
             'The `nvm` command was not found.',
             install_commands=install_commands)
Example #4
0
 def check_prerequisites(self):
     """Check if required prerequisites are installed or available."""
     status_command = 'gulp --version > /dev/null 2>&1'
     not_found = subprocess.call(status_command,
                                 **self.subprocess_args(shell=True)) == 127
     if not_found:
         install_commands = [
             'Either add gulp to package.json or install globally using:'
             ' `sudo npm install -g gulp`'
         ]
         raise base_installer.MissingPrerequisiteError(
             'The `gulp` command was not found.',
             install_commands=install_commands)
Example #5
0
 def _check_prerequisites_npm(self):
     """Check if required prerequisites are installed or available."""
     status_command = self._nvm_command('npm --version > /dev/null 2>&1')
     not_found = subprocess.call(status_command,
                                 **self.subprocess_args(shell=True)) == 127
     if not_found:
         install_commands = []
         if sdk_utils.PLATFORM == 'linux':
             install_commands.append(
                 'On Linux, you can install npm using: `apt-get install nodejs`'
             )
         elif sdk_utils.PLATFORM == 'mac':
             install_commands.append(
                 'Using brew (https://brew.sh), you can install using: `brew install node`'
             )
             install_commands.append(
                 ('If you do not have brew, you can download '
                  'Node.js from https://nodejs.org'))
         else:
             install_commands.append(
                 'Download Node.js from https://nodejs.org')
         raise base_installer.MissingPrerequisiteError(
             'The `npm` command was not found.',
             install_commands=install_commands)