コード例 #1
0
    def create_app_bootstrap(self):
        """ Create the bootstrap file. """
        app_dir = self.app_model.app_dir
        bootstrap = join(app_dir, settings.BOOTSTRAP_NAME)
        tmp = join(settings.TEMPLATE_DIR, settings.BOOTSTRAP_TEMPLATE)
        template = join(os.path.dirname(__file__), tmp)

        # fill substitutes
        substitutes = settings.BOOTSTRAP_SUBS
        substitutes['package'] = self.app_model.name
        if not create_templated_file(bootstrap, template, substitutes):
            message = "Can't create bootstrap file: {0}".format(bootstrap)
            self.view.print_error_and_exit(message)

        # sourcing
        if not bash_file(bootstrap):
            message = "Package install failed!"
            self.view.print_error_and_exit(message)
コード例 #2
0
ファイル: test_utils.py プロジェクト: stephanepechard/appypi
def test_source_not_bash_file():
    uid = uuid.uuid4()
    dir_path = os.path.join('/tmp', uid.hex)
    sourced = bash_file(dir_path)
    assert_equal(sourced, False)