Add a package npm task and check in a generated file
This commit is contained in:
parent
04568d271e
commit
71c06c7da4
14
Cakefile
14
Cakefile
|
@ -77,7 +77,8 @@ task 'build', 'build Chosen from source', build = (cb) ->
|
|||
write_chosen_javascript javascript.replace(/\.js$/,'.min.js'), (
|
||||
uglify.gen_code uglify.ast_squeeze uglify.ast_mangle parser.parse code
|
||||
)
|
||||
cb() if typeof cb is 'function'
|
||||
package_npm () ->
|
||||
cb() if typeof cb is 'function'
|
||||
catch e
|
||||
print_error e, file_name, file_contents
|
||||
|
||||
|
@ -94,6 +95,17 @@ task 'watch', 'watch coffee/ for changes and build Chosen', ->
|
|||
invoke 'build'
|
||||
)(file)
|
||||
|
||||
task 'package_npm', 'generate the package.json file for npm', package_npm = (cb) ->
|
||||
try
|
||||
package_file = 'package.json'
|
||||
package = JSON.parse("#{fs.readFileSync package_file}")
|
||||
package['version'] = version()
|
||||
fs.writeFileSync package_file, JSON.stringify(package, null, 2)
|
||||
console.log "Wrote #{package_file}"
|
||||
cb() if typeof cb is 'function'
|
||||
catch e
|
||||
print_error e, package_file
|
||||
|
||||
run = (cmd, args, cb, err_cb) ->
|
||||
exec "#{cmd} #{args.join(' ')}", (err, stdout, stderr) ->
|
||||
if err isnt null
|
||||
|
|
10
package.json
10
package.json
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"author": "harvest",
|
||||
"name": "chosen",
|
||||
"version": "0.9.5-35-g880a30d",
|
||||
"version": "0.9.6",
|
||||
"description": "Chosen is a JavaScript plugin that makes long, unwieldy select boxes much more user-friendly. It is currently available in both jQuery and Prototype flavors.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -10,9 +10,9 @@
|
|||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"coffee-script": ">= 1.2.0",
|
||||
"uglify-js": ">= 1.2.3"
|
||||
},
|
||||
"devDependencies": {}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue