view piecrust/publishing/shell.py @ 996:92a98c84a925

cm: Fix crashes when page assets deployment fails. This can happen for instance if page assets are read-only files.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 12 May 2017 09:26:37 -0700
parents 42da89d8bd51
children 13e8b50a2113
line wrap: on
line source

import shlex
from piecrust.publishing.base import ShellCommandPublisherBase


class ShellCommandPublisher(ShellCommandPublisherBase):
    PUBLISHER_NAME = 'shell'

    def _getCommandArgs(self, ctx):
        target_cmd = self.getConfigValue('command')
        if not target_cmd:
            raise Exception("No command specified for publish target: %s" %
                            self.target)
        args = shlex.split(target_cmd)
        return args