forked from lucasmotta/dploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
47 lines (37 loc) · 1012 Bytes
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module.exports = (grunt) ->
# Load tasks
Object.keys(require("./package.json").devDependencies).forEach (dep) -> grunt.loadNpmTasks dep if dep.substring(0,6) is "grunt-"
# Project configuration
grunt.initConfig
# Compile Coffee
coffee:
source:
expand: true
cwd: "src"
src: ["**/*.coffee"]
dest: "lib"
ext: ".js"
# CoffeeLint
coffeelint:
options:
no_tabs: level: "ignore"
indentation: level: "ignore"
max_line_length: level: "ignore"
source: ["src/**/*.coffee"]
# Bump files
bump:
options:
pushTo: "origin master"
# Publish to NPM
shell:
publish:
command: "npm publish"
# Watch for changes
watch:
coffee:
files: ["src/**/*.coffee"]
tasks: ["coffee"]
grunt.registerTask "default", ["coffeelint", "coffee"]
grunt.registerTask "release", "Release a new version, push it and publish", (target) ->
target ?= "patch"
grunt.task.run "coffeelint", "bump-only:#{target}", "coffee", "bump-commit", "shell:publish"