Skip to content

Commit

Permalink
Update Mod.js plugin generator.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanyan committed Feb 16, 2014
1 parent 931d33d commit 8487202
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// A sample Modfile
// More info at https://github.com/modulejs/modjs/
// Mod.js
// More info at https://github.com/modjs/mod/

module.exports = {
plugins: {
Expand All @@ -13,4 +13,4 @@ module.exports = {
targets : {
dist: "mkdir"
}
};
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// A sample Modfile
// More info at https://github.com/modulejs/modjs/
// Mod.js
// More info at https://github.com/modjs/mod/

module.exports = {
plugins: {
Expand All @@ -11,4 +11,4 @@ module.exports = {
dest: ""
}
}
};
};
2 changes: 1 addition & 1 deletion lib/generators/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports = {
}
}
};
```
```
4 changes: 2 additions & 2 deletions lib/generators/plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ exports.generators = {

exports.run = function (options) {
exports.copyTemplate('README.md');
exports.copyTemplate('Modfile', "./test/Modfile", true, true);
exports.copyTemplate('Modfile.js', "./test/Modfile.js", true, true);
exports.copyTemplate('{{main_name}}.js');
};
};
23 changes: 11 additions & 12 deletions lib/generators/plugin/{{main_name}}.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
exports.summary = '{{description}}';

exports.usage = '<src> [options]';
exports.summary = "{{description}}";

exports.options = {
"dest" : {
alias : 'd'
,default : '<src>'
,describe : 'destination file'
src: {
describe: "source file"
},

"charset" : {
alias : 'c'
,default : 'utf-8'
,describe : 'file encoding type'
dest: {
default: "<src>"
,describe: "destination file"
},
charset: {
default: "utf-8"
,describe: "file encoding type"
}
};

exports.run = function (options) {
var src = options.src;
var dest = options.dest;
var charset = options.charset;

exports.log("it's work!");
};

0 comments on commit 8487202

Please sign in to comment.