Skip to content

Commit ac8a46f

Browse files
committed
Add development mode.
1 parent c6def95 commit ac8a46f

File tree

4 files changed

+96
-1
lines changed

4 files changed

+96
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## HEAD
44

5+
- Add development mode using Gulp.
56
- Must set execute bit on `.tmux` files.
67

78
## 0.2.0

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,41 @@ Here is an example of a command you can use to make replacements:
9797
$ git ls-files -z | xargs -0 sed -i 's/rxrc\/tmuxrc/username\/tmuxrc/g'
9898
```
9999

100+
## Development
101+
102+
You can use [Gulp] to switch to development mode
103+
which will install the local development files to the plugin path.
104+
105+
First, follow the normal install steps if you haven't already.
106+
Then, install the development dependences via [npm] with
107+
108+
```bash
109+
$ [sudo] npm install --global gulp
110+
$ npm install
111+
```
112+
113+
While in a tmux session, enter development mode with
114+
115+
```bash
116+
$ gulp dev
117+
```
118+
119+
After entering development mode,
120+
have gulp watch for changes with
121+
122+
```bash
123+
$ gulp
124+
```
125+
126+
To switch out of development mode run
127+
128+
```bash
129+
$ gulp nodev
130+
```
131+
132+
[Gulp]: http://gulpjs.com/
133+
[npm]: https://www.ruby-lang.org/en/
134+
100135
## Contributing
101136

102137
Please submit and comment on bug reports and feature requests.

gulpfile.coffee

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'use strict'
2+
3+
gulp = require('gulp')
4+
del = require('del')
5+
path = require('path')
6+
homePath = require('home-path')()
7+
$ = require('gulp-load-plugins')()
8+
9+
repoPath = 'rxrc/tmuxrc'
10+
11+
pluginPath = "#{homePath}/.tmux/plugins/tmuxrc"
12+
13+
tpm = (task) ->
14+
"#{homePath}/.tmux/plugins/tpm/scripts/#{task}.sh &>/dev/null"
15+
16+
tpmUpdate = [
17+
tpm('install_plugins')
18+
tpm('install_plugins')
19+
].join('; ')
20+
21+
gulp.task 'default', ['watch']
22+
23+
gulp.task 'dev', ['clean', 'install'],
24+
$.shell.task([tpmUpdate])
25+
26+
gulp.task 'nodev', ['clean'],
27+
$.shell.task([tpmUpdate])
28+
29+
gulp.task 'clean', ->
30+
del(pluginPath, {force: true})
31+
32+
gulp.task 'install', ->
33+
gulp.src('*.tmux')
34+
.pipe gulp.dest(pluginPath)
35+
36+
gulp.src('plugin/**/*.conf')
37+
.pipe gulp.dest("#{pluginPath}/plugin")
38+
39+
gulp.src('plugins.conf')
40+
.pipe $.replace(repoPath, pluginPath)
41+
.pipe gulp.dest(pluginPath)
42+
43+
gulp.task 'watch', ['install'], ->
44+
$.watch ['./*.tmux', './*.conf', './plugin/**/*.conf'], (file) ->
45+
if file.event is 'unlink'
46+
del(file.path, {force: true})
47+
.pipe $.replace(repoPath, pluginPath)
48+
.pipe gulp.dest(pluginPath)
49+
.pipe $.shell([tpmUpdate])

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,15 @@
1717
"bugs": {
1818
"url": "https://github.com/rxrc/tmuxrc/issues"
1919
},
20-
"homepage": "https://github.com/rxrc/tmuxrc"
20+
"homepage": "https://github.com/rxrc/tmuxrc",
21+
"devDependencies": {
22+
"coffee-script": "^1.9.0",
23+
"del": "^1.1.1",
24+
"gulp": "^3.8.11",
25+
"gulp-load-plugins": "^0.8.0",
26+
"gulp-replace": "^0.5.2",
27+
"gulp-shell": "^0.4.2",
28+
"gulp-watch": "^4.1.1",
29+
"home-path": "^0.1.1"
30+
}
2131
}

0 commit comments

Comments
 (0)