<!-- deploy a local FRAPI server with admin in build/ -->
<target name="local" 
 description="Deploy FRAPI to the local build directory">
  <propertyprompt 
    propertyName="frapi.redeploy.core" 
    defaultValue="N"
    promptText="Redeploy local FRAPI core? (yN)" />
  <if>
    <contains 
      string="${frapi.redeploy.core}" 
      substring="y" 
      casesensitive="false"/>
    <then>
      <!-- recreate build path -->
      <delete dir="${build.path.local}/"/>
      <mkdir dir="${build.path.local}"/>
      <!-- remove the symlink -->
      <delete file="${frapi.custom.path.local}/"/>
      <gitclone 
        gitPath="${git.path}" 
        repository="${git.frapi-core.url}" 
        targetpath="${build.path.local}" />
      <gitcheckout 
        gitPath="${git.path}" 
        repository="${build.path.local}" 
        branchname="${git.frapi-core.commit}"
        quiet="true"/>
      <delete dir="${frapi.custom.path.local}"/>
      <symlink 
        target="${root.path.custom}" 
        link="${frapi.custom.path.local}" />
    </then>
  </if>
</target>
