Skip to content

Commit 80f1cc1

Browse files
committed
Add tsd "rebundle" command
Add "rebundle" command which calls API.updateBundle similarly to how CLI.rebundle works.
1 parent 98c1057 commit 80f1cc1

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

lib/tsd.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,23 @@ function getRunner(logger) {
4646
return api.reinstall(opts);
4747
});
4848
}
49+
50+
function rebundle(setting) {
51+
logger.log('execute command: rebundle');
52+
53+
var api = getAPI(setting);
54+
return api.readConfig(setting.config, true).then(function () {
55+
var opts = tsd.Options.fromJSON(setting.opts);
56+
logger.log('running...');
57+
return api.updateBundle(api.context.config.bundle, true);
58+
});
59+
}
4960

5061
return {
5162
getAPI: getAPI,
5263
commands: {
53-
reinstall: reinstall
64+
reinstall: reinstall,
65+
rebundle: rebundle
5466
}
5567
};
5668
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gulp-tsd",
33
"author": "moznion <[email protected]>",
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"description": "Gulp plugin to automate TSD and TypeScript definition related tasks",
66
"main": "index.js",
77
"scripts": {

0 commit comments

Comments
 (0)