gulpfile-publish.js 956 B

1234567891011121314151617181920212223242526272829
  1. module.exports = function(gulp, plugins) {
  2. var argv = require('yargs').argv,
  3. path = require('path'),
  4. svn = require('svn-push'),
  5. log = console.log;
  6. var that = this;
  7. that.message = argv.m || '初始化项目';
  8. var pkg = require('../package.json');
  9. var proj_namespace = [pkg.description, pkg.name, pkg.version+'/'].join('/')
  10. var homedir = process.env[(process.platform == 'win32')?'USERPROFILE':'HOME']
  11. var config = require(homedir+'/.generator-lego/config.json')
  12. gulp.task('publish', function(){
  13. svn({
  14. message: that.message,
  15. username: config.svnUsr,
  16. password: config.svnPwd,
  17. trymkdir: true,
  18. pushIgnore: ['*.html', '.DS_Store', '.idea/**', '.tmp_svn/**', '.svn/**'],
  19. src: 'dest',
  20. dest: 'http://svn.duowan.com:9999/svn/web/program/assets/' + proj_namespace,
  21. tmp: '.tmp_svn'
  22. })
  23. })
  24. }