def doAddPackage(self, rawPackage):
        try:
            self.composerJson = ComposerJsonFileLoader(os.path.join(self.locateComposerJsonFolder(), 'composer.json') )

            splitInput = rawPackage.split(':')
            name = splitInput[0]
            if 1 == len(splitInput) :
                version = "*"
            else:
                version =splitInput[1]

            if 0 == len(name):
                raise Exception('Please provide a package name')

            bin  = Prefs.composerCommand
            cmd  = 'require'
            args = ["%s:%s" %(name, version)] + Prefs.composerRequireExtra

            self.go(bin, cmd, args)

        except Exception:
            e = sys.exc_info()[1]
            ow = OutputWindow(self.view.window())
            ow.write("Composer Error:\n\t" )
            ow.write("%s" % e)
dataset/ETHPy150Open francodacosta/composer-sublime/composer.py/ComposerAddPackageCommand.doAddPackage/original