{"id":4828,"date":"2017-01-09T14:03:02","date_gmt":"2017-01-09T06:03:02","guid":{"rendered":"https:\/\/lttt.blog.ustc.edu.cn\/?p=4828"},"modified":"2017-01-09T14:03:02","modified_gmt":"2017-01-09T06:03:02","slug":"wpchajiankaifazidongtijiaodaosvndeyigejiaoben","status":"publish","type":"post","link":"https:\/\/lttt.vanabel.cn\/?p=4828","title":{"rendered":"WP\u63d2\u4ef6\u5f00\u53d1:\u81ea\u52a8\u63d0\u4ea4\u5230svn\u7684\u4e00\u4e2a\u811a\u672c"},"content":{"rendered":"<p>\u5728\u6211\u5199Wordpress\u63d2\u4ef6latex2html\u8fc7\u7a0b\u4e2d, \u9700\u8981\u63d0\u4ea4\u5230WP\u7684\u63d2\u4ef6\u76ee\u5f55, \u4e0b\u9762\u8fd9\u4e2a\u5b8f\u53ef\u4ee5\u5b9e\u73b0\u63d0\u4ea4.<br \/>\n\u6b64\u5916, \u82e5svn\u76ee\u5f55\u4e0d\u5b58\u5728, \u5219\u8fd8\u4f1a\u521b\u5efasvn\u76ee\u5f55\u5e76\u83b7\u53d6\u8fdc\u7a0b\u7248\u672c\u5e93.<\/p>\n<pre class=\"lang:sh decode:true \" >#!\/bin\/bash\n# This script will submit latex2html to wp plugin directory\nsdir_default='\/cygdrive\/c\/USBWEBS\/root\/wordpress\/wp-content\/plugins\/latex2html'\nsvn_default='\/home\/VanAbel\/latex2html'\ntag_default='2.0.6'\nread -p \"Input the source directory [$sdir_default]: \" sdir\nsdir=${sdir:-$sdir_default}\nread -p \"Input the svn directory [$svn_default]: \" svn \nsvn=${svn:-$svn_default}\nif [ ! -d \"$sdir\" ]; then\n  echo \"$sdir does not exist!\"\nelse\n  if [ ! -d \"$svn\" ]; then\n    echo \"$svn does not exist!\"\n    read -p \"Do you want to create?[Y\/n]\" createsvn\n    createsvn=${createsvn:-Y}\n    if [ \"$createsvn\" == \"Y\" ]; then\n      mkdir -p $svn\n      echo \"Input the plugin directory name on wordpress, e.g.\"\n      echo \"if you input latex2html, then your repository will be\"\n      echo \"https:\/\/plugins.svn.wordpress.org\/latex2html\"\n      read -p \"Your plugin directory name on wordpress:\" plugname\n      repo=\"https:\/\/plugins.svn.wordpress.org\/$plugname\"\n      echo \"==============SVN Checkout==============\"\n      svn co $repo $svn\n      echo \"==Please run the script again to submit==\"\n    fi\n  else\n    pushd $svn\n    echo \"===============SVN Update===============\"\n    # Get the newest remote version\n    svn up\n    echo \"==========SVN Update Complete===========\"\n    echo \n    echo \"=========1. Back up trunk to tags=======\"\n    read -p \"Which tag you want to use? [$tag_default]: \" tag\n    tag=${tag:-2.0.6}\n    while [ -d \"tags\/$tag\" ]\n    do\n      read -p \"$tag exits, are you sure to continue? [y\/N]: \" removetag\n      removetag=${removetag:-N}\n      if [ \"$removetag\" == \"N\" ]; then\n\tread -p \"Enter new tag you want to use: \" tag\n\ttag=${tag}\n      else\n\t# Remove the tags if exists\n\tsvn rm --force tags\/$tag\n\tbreak\n      fi\n    done\n    # Backup current trunk to new tags\n    svn cp trunk tags\/$tag\n    svn ci -m \"tagging version $tag\"\n\n    echo \"=========2. Copy source to trunk========\"\n    # Remove the trunk content\n    svn rm  --force trunk\/*\n\n    cp -r $sdir\/* trunk\/\n    svn add trunk\/*\n    # Show the status and difference\n    svn stat\n    svn diff\n\n    echo \"====3. Submit to wp plugin directory====\"\n    svn ci -m \"New version $tag\"\n    popd\n  fi\nfi<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6211\u5199Wordpress\u63d2\u4ef6latex2html\u8fc7\u7a0b\u4e2d, \u9700\u8981\u63d0\u4ea4\u5230WP\u7684\u63d2\u4ef6\u76ee &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"more-link\" href=\"https:\/\/lttt.vanabel.cn\/?p=4828\"> <span class=\"screen-reader-text\">WP\u63d2\u4ef6\u5f00\u53d1:\u81ea\u52a8\u63d0\u4ea4\u5230svn\u7684\u4e00\u4e2a\u811a\u672c<\/span> \u9605\u8bfb\u66f4\u591a &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[226,638,682,703,704],"class_list":["post-4828","post","type-post","status-publish","format-standard","hentry","category-net","tag-bash","tag-svn","tag-wordpress","tag-tijiao","tag-704"],"_links":{"self":[{"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=\/wp\/v2\/posts\/4828","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4828"}],"version-history":[{"count":0,"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=\/wp\/v2\/posts\/4828\/revisions"}],"wp:attachment":[{"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4828"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4828"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lttt.vanabel.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4828"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}