Skip to content

Commit aa62c0b

Browse files
committed
Workaround for JSDuck misbehaving on Windows
1 parent 340656c commit aa62c0b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Gruntfile.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ module.exports = function(grunt) {
6666
files: [
6767
'src/mainloop.js',
6868
],
69-
tasks: ['uglify', 'exec'],
69+
tasks: ['uglify', 'exec:jsduck_notify'],
7070
},
7171
exec: {
72+
jsduck_notify: {
73+
// For some reason I can't get jsduck to run programmatically on
74+
// Windows, but it works manually, so this is a workaround.
75+
command: 'node -p "\'You need to run \\"jsduck --config=.jsduck.json\\" from the project directory to generate updated documentation.\'"',
76+
},
7277
jsduck: {
7378
command: 'jsduck --config=.jsduck.json',
74-
}
79+
},
7580
},
7681
});
7782

@@ -80,6 +85,7 @@ module.exports = function(grunt) {
8085
grunt.loadNpmTasks('grunt-contrib-watch');
8186
grunt.loadNpmTasks('grunt-exec');
8287
grunt.loadNpmTasks('grunt-jscs');
83-
grunt.registerTask('default', ['uglify', 'jshint', 'jscs', 'exec']);
88+
grunt.registerTask('default', ['uglify', 'jshint', 'jscs', 'exec:jsduck_notify']);
8489
grunt.registerTask('lint', ['jshint', 'jscs']);
90+
grunt.registerTask('docs', ['exec:jsduck']);
8591
};

docs/source/mainloop.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@
739739
define(root.MainLoop);
740740
}
741741
// CommonJS support
742-
else if (typeof exports === 'object') {
742+
else if (typeof module === 'object' && module !== null && typeof module.exports === 'object') {
743743
module.exports = root.MainLoop;
744744
}
745745

0 commit comments

Comments
 (0)