-
Notifications
You must be signed in to change notification settings - Fork 33
/
meta.js
34 lines (30 loc) · 1.04 KB
/
meta.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
28
29
30
31
32
33
34
var fs = require('fs');
function onerror(err) {
if ( err ) console.log('ERROR: ' + err);
}
module.exports = {
"prompts": {
"name": {
"type": "string",
"required": true,
"label": "Project name"
}
},
"skipInterpolation": "frontend/**/*.vue",
// "completeMessage": "{{#inPlace}}To get started:\n\n npm install\n npm run dev.{{else}}To get started:\n\n cd {{destDirName}}\n npm install\n npm run dev.{{/inPlace}}",
"complete": function (data, {logger, chalk}) {
const base = data.inPlace ? '' : data.destDirName + '/'
fs.rename(`${base}__name__`, `${base}${data.name}`, onerror)
cmds = data.inPlace ? '' : `cd ${data.destDirName}\n `
cmds += `follow the instructions on README.md
(or see https://github.com/evolutio/djavue/blob/master/template/README.md)`
const message = `
# ${chalk.green('Project initialization finished!')}
# ========================
To get started:
${chalk.yellow(cmds)}
Documentation can be found at https://github.com/evolutio/djavue
`
console.log(message)
},
}