Skip to content

Instantly share code, notes, and snippets.

@1stvamp
Forked from lovett/phing-upgrade-wordpress
Created April 1, 2011 11:03
Show Gist options
  • Save 1stvamp/898003 to your computer and use it in GitHub Desktop.
Save 1stvamp/898003 to your computer and use it in GitHub Desktop.
<target name="wordpress.upgrade">
<property name="tmp" value="/tmp" />
<property name="src" value="${tmp}/wordpress" />
<delete dir="${src}" includeemptydirs="true" failonerror="true" />
<exec dir="${tmp}" command="curl -s http://wordpress.org/latest.tar.gz | tar -xz" />
<delete dir="wp-admin" includeemptydirs="true" failonerror="true" />
<delete dir="wp-includes" includeemptydirs="true" failonerror="true" />
<move file="wp-config.php" tofile="wp-config.php.bak" overwrite="true"/>
<move file="share-via-email.php" tofile="share-via-email.bak" overwrite="true"/>
<delete>
<fileset dir=".">
<include name="*.html" />
<include name="*.php" />
<include name="*.txt" />
</fileset>
</delete>
<exec command="cp -r ${src}/wp-admin ." />
<exec command="cp -r ${src}/wp-includes ." />
<exec command="cp ${src}/*.html ." />
<exec command="cp ${src}/*.php ." />
<exec command="cp ${src}/*.txt ." />
<move file="wp-config.php.bak" tofile="wp-config.php" overwrite="true"/>
<move file="share-via-email.bak" tofile="share-via-email.php" overwrite="true"/>
<delete dir="${src}" includeemptydirs="true" failonerror="true" />
<delete>
<fileset dir=".">
<include name="wp-config-sample.php" />
</fileset>
</delete>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment