init
This commit is contained in:
15
snippets/snippet/index.js
Normal file
15
snippets/snippet/index.js
Normal file
@ -0,0 +1,15 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
exports.run = async (folder, args) => {
|
||||
const snipFolder = path.join(folder, args[0]);
|
||||
const template = path.join(__dirname, 'template');
|
||||
fs.mkdir(snipFolder);
|
||||
fs.copy(path.join(template, 'index.js'), path.join(snipFolder, 'index.js'));
|
||||
};
|
||||
|
||||
exports.assert = (args) {
|
||||
assert(args.length == 1);
|
||||
assert(typeof args[0] == 'string');
|
||||
assert(/^[a-zA-Z]+$/u.test(args[0]))
|
||||
}
|
5
snippets/vue/index.js
Normal file
5
snippets/vue/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
const fs = require('fs');
|
||||
|
||||
module.exports = async folder => {
|
||||
|
||||
};
|
Reference in New Issue
Block a user