Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 264bf9a

Browse files
author
Axel Rindle
authored
Merge pull request #2 from axelrindle/develop
Added an option to fetch latest release only (excluding pre-releases) or all releases (including pre-releases)
2 parents 14e4bfe + 9ed4bee commit 264bf9a

15 files changed

Lines changed: 1303 additions & 265 deletions

examples/callback.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
4+
// register coffeescript
5+
require('coffeescript/register')
6+
7+
const versionCheck = require('../lib/main')
8+
const options = {
9+
repo: 'axelrindle/github-version-checker',
10+
currentVersion: require('../package.json').version
11+
}
12+
13+
versionCheck(options, function (update, error) {
14+
if (error) {
15+
console.error(error);
16+
process.exit(-1)
17+
}
18+
19+
if (update) {
20+
console.log("An update is available! " + update.tag_name);
21+
console.log("You are on version " + options.currentVersion + "!");
22+
} else {
23+
console.log("You are up to date.");
24+
}
25+
})

examples/promise.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env node
2+
'use strict'
3+
4+
// register coffeescript
5+
require('coffeescript/register')
6+
7+
const versionCheck = require('../lib/main')
8+
const options = {
9+
repo: 'axelrindle/github-version-checker',
10+
currentVersion: require('../package.json').version
11+
}
12+
13+
versionCheck(options).then(function (update) {
14+
if (update) { // update is null if there is no update available, so check here
15+
console.log("An update is available! " + update.tag_name)
16+
console.log("You are on version " + options.currentVersion + "!")
17+
} else {
18+
console.log("You are up to date.");
19+
}
20+
}).catch(function (error) {
21+
console.error(error)
22+
})

examples/promise_async.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env node
2+
(async () => {
3+
4+
// register coffeescript
5+
require('coffeescript/register')
6+
7+
const versionCheck = require('../lib/main')
8+
const options = {
9+
repo: 'axelrindle/github-version-checker',
10+
currentVersion: require('../package.json').version
11+
}
12+
13+
try {
14+
update = await versionCheck(options)
15+
if (update) { // update is null if there is no update available, so check here
16+
console.log("An update is available! " + update.tag_name)
17+
console.log("You are on version " + options.currentVersion + "!")
18+
} else {
19+
console.log("You are up to date.");
20+
}
21+
} catch (e) {
22+
console.error(e);
23+
}
24+
})()

gulp/coffeelint.json

Lines changed: 135 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,135 @@
1-
{
2-
"arrow_spacing": {
3-
"level": "ignore"
4-
},
5-
"braces_spacing": {
6-
"level": "ignore",
7-
"spaces": 0,
8-
"empty_object_spaces": 0
9-
},
10-
"camel_case_classes": {
11-
"level": "error"
12-
},
13-
"coffeescript_error": {
14-
"level": "error"
15-
},
16-
"colon_assignment_spacing": {
17-
"level": "ignore",
18-
"spacing": {
19-
"left": 0,
20-
"right": 0
21-
}
22-
},
23-
"cyclomatic_complexity": {
24-
"level": "ignore",
25-
"value": 10
26-
},
27-
"duplicate_key": {
28-
"level": "error"
29-
},
30-
"empty_constructor_needs_parens": {
31-
"level": "ignore"
32-
},
33-
"ensure_comprehensions": {
34-
"level": "warn"
35-
},
36-
"eol_last": {
37-
"level": "ignore"
38-
},
39-
"indentation": {
40-
"value": 2,
41-
"level": "error"
42-
},
43-
"line_endings": {
44-
"level": "ignore",
45-
"value": "unix"
46-
},
47-
"max_line_length": {
48-
"value": 120,
49-
"level": "warn",
50-
"limitComments": false
51-
},
52-
"missing_fat_arrows": {
53-
"level": "ignore",
54-
"is_strict": false
55-
},
56-
"newlines_after_classes": {
57-
"value": 3,
58-
"level": "ignore"
59-
},
60-
"no_backticks": {
61-
"level": "error"
62-
},
63-
"no_debugger": {
64-
"level": "warn",
65-
"console": false
66-
},
67-
"no_empty_functions": {
68-
"level": "ignore"
69-
},
70-
"no_empty_param_list": {
71-
"level": "ignore"
72-
},
73-
"no_implicit_braces": {
74-
"level": "ignore",
75-
"strict": true
76-
},
77-
"no_implicit_parens": {
78-
"level": "ignore",
79-
"strict": true
80-
},
81-
"no_interpolation_in_single_quotes": {
82-
"level": "ignore"
83-
},
84-
"no_nested_string_interpolation": {
85-
"level": "warn"
86-
},
87-
"no_plusplus": {
88-
"level": "ignore"
89-
},
90-
"no_private_function_fat_arrows": {
91-
"level": "warn"
92-
},
93-
"no_stand_alone_at": {
94-
"level": "ignore"
95-
},
96-
"no_tabs": {
97-
"level": "error"
98-
},
99-
"no_this": {
100-
"level": "ignore"
101-
},
102-
"no_throwing_strings": {
103-
"level": "error"
104-
},
105-
"no_trailing_semicolons": {
106-
"level": "error"
107-
},
108-
"no_trailing_whitespace": {
109-
"level": "error",
110-
"allowed_in_comments": false,
111-
"allowed_in_empty_lines": true
112-
},
113-
"no_unnecessary_double_quotes": {
114-
"level": "ignore"
115-
},
116-
"no_unnecessary_fat_arrows": {
117-
"level": "warn"
118-
},
119-
"non_empty_constructor_needs_parens": {
120-
"level": "ignore"
121-
},
122-
"prefer_english_operator": {
123-
"level": "ignore",
124-
"doubleNotLevel": "ignore"
125-
},
126-
"space_operators": {
127-
"level": "ignore"
128-
},
129-
"spacing_after_comma": {
130-
"level": "ignore"
131-
},
132-
"transform_messes_up_line_numbers": {
133-
"level": "warn"
134-
}
135-
}
1+
{
2+
"arrow_spacing": {
3+
"level": "ignore"
4+
},
5+
"braces_spacing": {
6+
"level": "ignore",
7+
"spaces": 0,
8+
"empty_object_spaces": 0
9+
},
10+
"camel_case_classes": {
11+
"level": "error"
12+
},
13+
"coffeescript_error": {
14+
"level": "error"
15+
},
16+
"colon_assignment_spacing": {
17+
"level": "ignore",
18+
"spacing": {
19+
"left": 0,
20+
"right": 0
21+
}
22+
},
23+
"cyclomatic_complexity": {
24+
"level": "ignore",
25+
"value": 10
26+
},
27+
"duplicate_key": {
28+
"level": "error"
29+
},
30+
"empty_constructor_needs_parens": {
31+
"level": "ignore"
32+
},
33+
"ensure_comprehensions": {
34+
"level": "warn"
35+
},
36+
"eol_last": {
37+
"level": "ignore"
38+
},
39+
"indentation": {
40+
"value": 2,
41+
"level": "error"
42+
},
43+
"line_endings": {
44+
"level": "ignore",
45+
"value": "unix"
46+
},
47+
"max_line_length": {
48+
"value": 120,
49+
"level": "warn",
50+
"limitComments": false
51+
},
52+
"missing_fat_arrows": {
53+
"level": "ignore",
54+
"is_strict": false
55+
},
56+
"newlines_after_classes": {
57+
"value": 3,
58+
"level": "ignore"
59+
},
60+
"no_backticks": {
61+
"level": "error"
62+
},
63+
"no_debugger": {
64+
"level": "warn",
65+
"console": false
66+
},
67+
"no_empty_functions": {
68+
"level": "ignore"
69+
},
70+
"no_empty_param_list": {
71+
"level": "ignore"
72+
},
73+
"no_implicit_braces": {
74+
"level": "ignore",
75+
"strict": true
76+
},
77+
"no_implicit_parens": {
78+
"level": "ignore",
79+
"strict": true
80+
},
81+
"no_interpolation_in_single_quotes": {
82+
"level": "ignore"
83+
},
84+
"no_nested_string_interpolation": {
85+
"level": "warn"
86+
},
87+
"no_plusplus": {
88+
"level": "ignore"
89+
},
90+
"no_private_function_fat_arrows": {
91+
"level": "warn"
92+
},
93+
"no_stand_alone_at": {
94+
"level": "ignore"
95+
},
96+
"no_tabs": {
97+
"level": "error"
98+
},
99+
"no_this": {
100+
"level": "ignore"
101+
},
102+
"no_throwing_strings": {
103+
"level": "error"
104+
},
105+
"no_trailing_semicolons": {
106+
"level": "error"
107+
},
108+
"no_trailing_whitespace": {
109+
"level": "error",
110+
"allowed_in_comments": false,
111+
"allowed_in_empty_lines": true
112+
},
113+
"no_unnecessary_double_quotes": {
114+
"level": "ignore"
115+
},
116+
"no_unnecessary_fat_arrows": {
117+
"level": "warn"
118+
},
119+
"non_empty_constructor_needs_parens": {
120+
"level": "ignore"
121+
},
122+
"prefer_english_operator": {
123+
"level": "ignore",
124+
"doubleNotLevel": "ignore"
125+
},
126+
"space_operators": {
127+
"level": "ignore"
128+
},
129+
"spacing_after_comma": {
130+
"level": "ignore"
131+
},
132+
"transform_messes_up_line_numbers": {
133+
"level": "warn"
134+
}
135+
}

gulp/index.coffee

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# which tasks to laod
2-
tasks = [
3-
'coffeelint'
4-
]
5-
6-
# load tasks
7-
gulp = require('./tasker')(tasks)
8-
9-
# execute tasks
10-
gulp.task 'default', gulp.series tasks
1+
# which tasks to load
2+
tasks = [
3+
'coffeelint'
4+
]
5+
6+
# load tasks
7+
gulp = require('./tasker') tasks
8+
9+
# execute tasks
10+
gulp.task 'default', gulp.series tasks

gulp/tasker.coffee

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
gulp = require('gulp')
2-
3-
module.exports = (tasks) ->
4-
tasks.forEach (name) ->
5-
gulp.task name, require('./tasks/' + name)
6-
return gulp
1+
gulp = require('gulp')
2+
3+
module.exports = (tasks) ->
4+
5+
# loop through the task array
6+
tasks.forEach (name) ->
7+
8+
# define a gulp task with the task's name and function
9+
gulp.task name, require('./tasks/' + name)
10+
11+
# then return the gulp object with the created tasks
12+
return gulp

0 commit comments

Comments
 (0)