Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit ca7a92f

Browse files
committed
Replace gulp-shell with node exec.
1 parent 01eb2f5 commit ca7a92f

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## HEAD
4+
5+
- Replace gulp-shell with node exec.
6+
37
## 1.2.0
48

59
**Rerunning the install script is recommended.**

gulpfile.coffee

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,34 @@
11
'use strict'
22

33
gulp = require('gulp')
4-
path = require('path')
54
homePath = require('home-path')()
5+
path = require('path')
6+
exec = require('child_process').exec
67
$ = require('gulp-load-plugins')()
78

9+
runCommands = (commands) ->
10+
exec commands.join('; '),
11+
(err, stdout, stderr) ->
12+
process.stdout.write stdout
13+
process.stdout.write stderr
14+
815
remotePluginPath = 'rxrc/vimrc'
9-
vimCmd = (cmd) ->
10-
"vim -N -u #{homePath}/.vimrc -c \"try | #{cmd} $* | finally | qall | endtry\" -U NONE -i NONE -V1 -e -s"
1116

12-
pluginInstall = () -> $.shell(vimCmd 'NeoBundleUpdate')
13-
pluginUpdate = () -> $.shell(vimCmd 'NeoBundleInstall')
14-
pluginClean = () -> $.shell(vimCmd 'NeoBundleClean!')
17+
vimCommand = (command) -> [
18+
'vim'
19+
'-N'
20+
"-u #{homePath}/.vimrc"
21+
"-c \"try | #{command} $* | finally | qall | endtry\""
22+
'-U NONE'
23+
'-i NONE'
24+
'-V1'
25+
'-e'
26+
'-s'
27+
].join(' ')
28+
29+
pluginInstall = vimCommand 'NeoBundleUpdate'
30+
pluginUpdate = vimCommand 'NeoBundleInstall'
31+
pluginClean = vimCommand 'NeoBundleClean!'
1532

1633
gulp.task 'default', ['dev']
1734

@@ -22,11 +39,7 @@ gulp.task 'dev', ->
2239
.pipe $.replace('$HOME/.vim/bundle/vimrc/plugins.vim', "#{path.resolve()}/plugins.vim")
2340
.pipe gulp.dest(homePath)
2441

25-
gulp.src('')
26-
.pipe pluginClean()
27-
.pipe pluginUpdate()
28-
.pipe pluginInstall()
29-
.pipe pluginClean()
42+
runCommands [pluginClean, pluginUpdate, pluginInstall, pluginClean]
3043

3144
gulp.task 'nodev', ->
3245
gulp.src("#{homePath}/.vimrc")
@@ -35,6 +48,4 @@ gulp.task 'nodev', ->
3548
.pipe $.replace("#{path.resolve()}/plugins.vim", '$HOME/.vim/bundle/vimrc/plugins.vim')
3649
.pipe gulp.dest(homePath)
3750

38-
gulp.src('')
39-
.pipe pluginClean()
40-
.pipe pluginInstall()
51+
runCommands [pluginClean, pluginInstall]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
"homepage": "https://github.com/rxrc/vimrc",
2020
"devDependencies": {
2121
"coffee-script": "^1.9.0",
22+
"execSync": "^1.0.2",
2223
"gulp": "^3.8.11",
2324
"gulp-load-plugins": "^0.8.0",
2425
"gulp-replace": "^0.5.2",
25-
"gulp-shell": "^0.3.0",
2626
"home-path": "^0.1.1"
2727
}
2828
}

0 commit comments

Comments
 (0)