var gulp = require('gulp');
var gutil = require('gulp-util');
var exec = require('gulp-exec');

// livereload
var livereload = require('gulp-livereload');
var lr = require('tiny-lr');
var server = lr();

var srcTheme = [
	'htdocs/wp/wp-content/themes/silproduct1/views/*.twig',
	'htdocs/wp/wp-content/themes/silproduct1/*.php',
	'htdocs/wp/wp-content/themes/silproduct1/*.css',
	'htdocs/wp/wp-content/themes/silproduct1/css/*.css',
	'htdocs/wp/wp-content/themes/silproduct1/js/*.js'
];

gulp.task('default', function() {
  // place code for your default task here
});

gulp.task('do-reload', function() {
	return gulp.src('htdocs/wp/index.php')
		.pipe(livereload(server));
});

gulp.task('reload', function() {
	server.listen(35729, function(err) {
		if (err) {
			return console.log(err);
		}
		gulp.watch(srcTheme, ['do-reload']);
	});
});

gulp.task('upload', function() {
	var options = {
		silent: false,
		src: "htdocs",
		dest: "root@software.sil.org:/var/www/sil.org_software/htdocs/",
		key: "/home/cambell/dev.key"
	};
	gulp.src('htdocs')
		.pipe(exec('rsync -rzlt --chmod=Dug=rwx,Fug=rw,o-rwx --delete --exclude-from="upload-exclude.txt" --stats --rsync-path="sudo -u www-data rsync" --rsh="ssh -i <%= options.key %>" <%= file.path %>/ <%= options.dest %>', options));
//	gulp.src('htdocs/images')
//		.pipe(exec('rsync -rzlt --chmod=Dug=rwx,Fug=rw,o-rwx --stats --rsync-path="sudo -u www-data rsync" --rsh="ssh -i <%= options.key %>" <%= file.path %>/ <%= options.dest %>images/', options));
});


gulp.task('db-backup', function() {
	var options = {
		silent: false,
		dest: "root@new.traintoproclaim.com",
		key: "/home/cambell/dev.key",
		password: gutil.env.password
	};
	gulp.src('')
		.pipe(exec('mysqldump -u cambell --password=<%= options.password %> traintoproclaim | gzip > backup/backup.sql.gz', options));
});

gulp.task('db-copy', ['db-backup'], function() {
	var options = {
		silent: false,
		dest: "root@new.traintoproclaim.com",
		key: "/home/cambell/dev.key",
		password: gutil.env.password
	};
	gulp.src('')
		.pipe(exec('ssh -C -i <%= options.key %> <%= options.dest %> mysqldump -u cambell --password=<%= options.password %> traintoproclaim2 | mysql -u cambell --password=<%= options.password %> -D traintoproclaim', options));
});


@@ -244,26 +244,33 @@
 /themes/
-sil
+web-
 product
+-theme
 1/views/
@@ -304,34 +304,41 @@
 tent/themes/
-sil
+web-
 product
+-theme
 1/*.php',%0A%09'
@@ -365,26 +365,33 @@
 /themes/
-sil
+web-
 product
+-theme
 1/*.css'
@@ -422,26 +422,33 @@
 /themes/
-sil
+web-
 product
+-theme
 1/css/*.
@@ -487,18 +487,25 @@
 mes/
-sil
+web-
 product
+-theme
 1/js

Change the name of the sample theme