我如何用当前日期作为目录名称的一部分创建一个新目录



我想使用基于ANT的部署工具。使用ANT,我如何使用当前日期作为目录名称的一部分创建新目录?

你可以这样做:

<target name="account">
  <tstamp>
    <format property="tstamped-file-name" pattern="ddMMMyyhhmmss" locale="nl,NL"/>
  </tstamp>
    <if>
        <available file="data/accounts.csv" property="account.present"/>
        <then>
             <sfdc object="AccountUpsertProcess"/>
             <move todir="status-history/Account${tstamped-file-name}">
                <fileset dir="data">
                    <include name="accounts.csv"/>
                </fileset>
                <fileset dir="status">
                    <include name="AccountUpsertProcess*.csv"/>
                </fileset>
             </move>
        </then>
        <else>
           <echo message="No account file"/>
        </else>
    </if>
</target>

相关内容

最新更新