Skip to content

Commit 538a906

Browse files
author
Jordalgo
committed
removed dependency on gulp in wordpress wrapper
Change-Id: Iad275312bf44b66860aa7f7bc5e67b5abdbba6d9
1 parent 01ac538 commit 538a906

File tree

4 files changed

+51
-56
lines changed

4 files changed

+51
-56
lines changed

README.md

+2-10
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,7 @@ OR
4141
php composer.phar update
4242
```
4343

44-
#### Download NPM Dependencies
45-
46-
For the wordpress wrapper:
47-
48-
```bash
49-
npm install
50-
```
51-
52-
For the theme:
44+
#### Download NPM Dependencies (if using the default theme)
5345

5446
```bash
5547
(cd wp-content/themes/default && npm install)
@@ -80,7 +72,7 @@ You can do this on the server or through the many helpful hosting control panel
8072
This will deploy all the above code to your remote server.
8173

8274
```bash
83-
gulp deploy
75+
node deploy.js
8476
```
8577

8678
#### Setting up Environment Vars

deploy.js

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
var spawn = require('child_process').spawn;
2+
var buildConf = require('./build-config.json');
3+
var THEMES_FOLDER = 'wp-content/themes/';
4+
var themeCount = buildConf.activeThemes.length;
5+
6+
function print(data) {
7+
console.log('' + data);
8+
}
9+
10+
function complete(code) {
11+
console.log('child process exited with code ' + code);
12+
}
13+
14+
function rsync() {
15+
console.log('Starting rsync...');
16+
var r = spawn(
17+
'rsync',
18+
[
19+
'-e',
20+
'ssh -p 2222',
21+
'-avz',
22+
'--exclude-from',
23+
'rsync-exclude-list.txt',
24+
'./ ',
25+
buildConf.remote
26+
],
27+
{ cwd: './' }
28+
);
29+
30+
r.stdout.pipe(process.stdout);
31+
r.stderr.pipe(process.stdout);
32+
r.on('close', complete);
33+
}
34+
35+
function prod(theme) {
36+
var p = spawn('npm', ['run', 'prod'], { cwd: 'wp-content/themes/' + theme });
37+
p.stdout.pipe(process.stdout);
38+
p.stderr.pipe(process.stdout);
39+
p.on('close', function(code) {
40+
complete(code);
41+
themeCount--;
42+
if (themeCount === 0) {
43+
rsync();
44+
}
45+
});
46+
}
47+
48+
buildConf.activeThemes.forEach(prod);
49+

gulpfile.js

-26
This file was deleted.

package.json

-20
This file was deleted.

0 commit comments

Comments
 (0)