-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
27 lines (26 loc) · 1.02 KB
/
Gruntfile.js
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
module.exports = function(grunt) {
grunt.initConfig({
publish: {
config: {username: 'yannisgu', password: process.env.NPM_PASSWORD, email: "[email protected]"},
}
});
grunt.registerMultiTask('publish', 'Publish the latest version of this plugin', function() {
var done = this.async(),
me = this,
npm = require('npm');
npm.load({}, function(err) {
npm.registry.adduser(me.data.username, me.data.password, me.data.email, function(err) {
if (err) {
console.log(err);
done(false);
} else {
npm.config.set("email", me.data.email, "user");
npm.commands.publish([], function(err) {
console.log(err || "Published to registry");
done(!err);
});
}
});
});
});
}