(self, spec, output, output_binary, is_command_start)
Returns a shell command that runs all the postbuilds, and removes
    |output| if any of them fails. If |is_command_start| is False, then the
    returned string will start with ' && '.
Returns a shell command that runs all the postbuilds, and removes
    |output| if any of them fails. If |is_command_start| is False, then the
    returned string will start with ' && '.
Returns a shell command that runs all the postbuilds and removes |output| if any of them fails . If |is_command_start| is False then the returned string will start with && .
def GetPostbuildCommand(self, spec, output, output_binary, is_command_start):
        """Returns a shell command that runs all the postbuilds, and removes
    |output| if any of them fails. If |is_command_start| is False, then the
    returned string will start with ' && '."""
        if not self.xcode_settings or spec["type"] == "none" or not output:
            return ""
        output = QuoteShellArgument(output, self.flavor)
        postbuilds = gyp.xcode_emulation.GetSpecPostbuildCommands(spec, quiet=True)
        if output_binary is not None:
            postbuilds = self.xcode_settings.AddImplicitPostbuilds(
                self.config_name,
                os.path.normpath(os.path.join(self.base_to_build, output)),
                QuoteShellArgument(
                    os.path.normpath(os.path.join(self.base_to_build, output_binary)),
                    self.flavor,
                ),
                postbuilds,
                quiet=True,
            )

        if not postbuilds:
            return ""
        # Postbuilds expect to be run in the gyp file's directory, so insert an
        # implicit postbuild to cd to there.
        postbuilds.insert(
            0, gyp.common.EncodePOSIXShellList(["cd", self.build_to_base])
        )
        env = self.ComputeExportEnvString(self.GetSortedXcodePostbuildEnv())
        # G will be non-null if any postbuild fails. Run all postbuilds in a
        # subshell.
        commands = (
            env
            + " ("
            + " && ".join([ninja_syntax.escape(command) for command in postbuilds])
        )
        command_string = (
            commands
            + "); G=$$?; "
            # Remove the final output if any postbuild failed.
            "((exit $$G) || rm -rf %s) " % output
            + "&& exit $$G)"
        )
        if is_command_start:
            return "(" + command_string + " && "
        else:
            return "$ && (" + command_string
def GetPostbuildCommand ( self , spec , output , output_binary , is_command_start ) : if not self . xcode_settings or spec [ "type" ] == "none" or not output : return "" output = QuoteShellArgument ( output , self . flavor ) postbuilds = gyp . xcode_emulation . GetSpecPostbuildCommands ( spec , quiet = True ) if output_binary is not None : postbuilds = self . xcode_settings . AddImplicitPostbuilds ( self . config_name , os . path . normpath ( os . path . join ( self . base_to_build , output ) ) , QuoteShellArgument ( os . path . normpath ( os . path . join ( self . base_to_build , output_binary ) ) , self . flavor , ) , postbuilds , quiet = True , ) if not postbuilds : return "" # Postbuilds expect to be run in the gyp file's directory, so insert an # implicit postbuild to cd to there. postbuilds . insert ( 0 , gyp . common . EncodePOSIXShellList ( [ "cd" , self . build_to_base ] ) ) env = self . ComputeExportEnvString ( self . GetSortedXcodePostbuildEnv ( ) ) # G will be non-null if any postbuild fails. Run all postbuilds in a # subshell. commands = ( env + " (" + " && " . join ( [ ninja_syntax . escape ( command ) for command in postbuilds ] ) ) command_string = ( commands + "); G=$$?; " # Remove the final output if any postbuild failed. "((exit $$G) || rm -rf %s) " % output + "&& exit $$G)" ) if is_command_start : return "(" + command_string + " && " else : return "$ && (" + command_string