Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Commit

Permalink
release
Browse files Browse the repository at this point in the history
  • Loading branch information
yesmeck committed Mar 23, 2014
1 parent f956d70 commit fdcf932
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 27 deletions.
59 changes: 33 additions & 26 deletions gulpfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ sass = require 'gulp-ruby-sass'
concat = require 'gulp-concat'
mocha = require 'gulp-mocha'
preprocess = require 'gulp-preprocess'
git = require 'gulp-git'
fs = require 'fs'

gulp.task 'default', ['mocha']
Expand Down Expand Up @@ -45,31 +46,37 @@ gulp.task 'watch', ->
gulp.watch('src/**/*', ['build', 'dist', 'mocha'])

gulp.task 'package', ->
src = 'package.json'
fs.readFile 'package.json', 'utf8', (error, data) ->
pkg = JSON.parse(data)
# jquery.json
json1 =
name: pkg.name,
description: pkg.description,
version: pkg.version,
author: pkg.author,
keywords: pkg.keywords,
homepage: pkg.homepage
json2 = pkg.jqueryJSON
json1[key] = json2[key] for key of json2
fs.writeFile 'jsonview.jquery.json', JSON.stringify(json1, null, 2)
data = fs.readFileSync 'package.json', 'utf8'
pkg = JSON.parse(data)
# jquery.json
json1 =
name: pkg.name,
description: pkg.description,
version: pkg.version,
author: pkg.author,
keywords: pkg.keywords,
homepage: pkg.homepage
json2 = pkg.jqueryJSON
json1[key] = json2[key] for key of json2
fs.writeFile 'jsonview.jquery.json', JSON.stringify(json1, null, 2)

# bower.json
json1 =
name: pkg.name,
description: pkg.description,
version: pkg.version,
main: pkg.main
keywords: pkg.keywords,
license: pkg.license,
homepage: pkg.homepage
json2 = pkg.bowerJSON
json1[key] = json2[key] for key of json2
fs.writeFile 'bower.json', JSON.stringify(json1, null, 2)
# bower.json
json1 =
name: pkg.name,
description: pkg.description,
version: pkg.version,
main: pkg.main
keywords: pkg.keywords,
license: pkg.license,
homepage: pkg.homepage
json2 = pkg.bowerJSON
json1[key] = json2[key] for key of json2
fs.writeFile 'bower.json', JSON.stringify(json1, null, 2)

gulp.task 'release', ['dist', 'package'], ->
data = fs.readFileSync 'package.json', 'utf8'
pkg = JSON.parse(data)
git.tag("v#{pkg.version}")
git.push('origin', 'master', {args: ' --tags'})
exec('npm publish')

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"gulp-ruby-sass": "^0.4.0",
"gulp-concat": "^2.2.0",
"gulp-mocha": "^0.4.1",
"gulp-preprocess": "^1.0.1"
"gulp-preprocess": "^1.0.1",
"gulp-git": "^0.3.6"
},
"jqueryJSON": {
"title": "jQuery JSONView",
Expand Down

0 comments on commit fdcf932

Please sign in to comment.