Shfmt task

Shfmt task

Description

Task to process shfmt : a shell formatter (see: github.com/mvdan/sh).

shfmt task parameters

Attribute Description Value Required
file the script input file yes, if no fileset
fileset the script input files no

Examples

/!\ shfmt must be installed on the system and set up in the PATH.

<project name="shfmt task"> 

  <taskdef name="shfmt" 
       classname="net.sourceforge.ant4x.taskdefs.linux.ShfmtTask" 
       classpath="PATH/TO/ant4x.jar"/> 

    <target name="shfmt1"> 
        <shfmt file="file.sh" />
    </target> 
    
    <target name="shfmt2"> 
        <shfmt>
            <fileset dir=".">
                <include name="**/*.sh"/>
            </fileset>
        </shfmt>
    </target> 

</project>