create-packer 1.20.1 → 1.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitignore +1 -0
- package/bin/createTemp.js +3 -3
- package/package.json +1 -1
- package/template/cli/src/createTemp.ts +3 -3
package/.gitignore
CHANGED
package/bin/createTemp.js
CHANGED
|
@@ -37,7 +37,7 @@ async function createTemp(dirname) {
|
|
|
37
37
|
choices: tempInfoList.map(o => o.name)
|
|
38
38
|
}
|
|
39
39
|
]);
|
|
40
|
-
|
|
40
|
+
let tempInfo = tempInfoList.find(o => o.name === answer.temp);
|
|
41
41
|
if (tempInfo.children) {
|
|
42
42
|
answer = await inquirer.prompt([
|
|
43
43
|
{
|
|
@@ -47,6 +47,7 @@ async function createTemp(dirname) {
|
|
|
47
47
|
choices: tempInfo.children.map(o => o.name)
|
|
48
48
|
}
|
|
49
49
|
]);
|
|
50
|
+
tempInfo = tempInfo.children.find(o => o.name === answer.temp);
|
|
50
51
|
}
|
|
51
52
|
const creating = ora(chalk.yellow('Creating...\n')).start();
|
|
52
53
|
const output = path.join(cwd, isCurrent ? '' : dirname);
|
|
@@ -56,8 +57,7 @@ async function createTemp(dirname) {
|
|
|
56
57
|
if (!isCurrent) {
|
|
57
58
|
fsExtra.mkdirSync(output);
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
copyTempFile(tempPath, output);
|
|
60
|
+
copyTempFile(tempInfo.src, output);
|
|
61
61
|
createTempEnd(output);
|
|
62
62
|
creating.succeed();
|
|
63
63
|
}
|
package/package.json
CHANGED
|
@@ -37,7 +37,7 @@ export async function createTemp(dirname: string) {
|
|
|
37
37
|
choices: tempInfoList.map(o => o.name)
|
|
38
38
|
}
|
|
39
39
|
])
|
|
40
|
-
|
|
40
|
+
let tempInfo = tempInfoList.find(o => o.name === answer.temp)
|
|
41
41
|
if (tempInfo.children) {
|
|
42
42
|
answer = await inquirer.prompt([
|
|
43
43
|
{
|
|
@@ -47,6 +47,7 @@ export async function createTemp(dirname: string) {
|
|
|
47
47
|
choices: tempInfo.children.map(o => o.name)
|
|
48
48
|
}
|
|
49
49
|
])
|
|
50
|
+
tempInfo = tempInfo.children.find(o => o.name === answer.temp)
|
|
50
51
|
}
|
|
51
52
|
const creating = ora(chalk.yellow('Creating...\n')).start()
|
|
52
53
|
const output = path.join(cwd, isCurrent ? '' : dirname)
|
|
@@ -56,8 +57,7 @@ export async function createTemp(dirname: string) {
|
|
|
56
57
|
if (!isCurrent) {
|
|
57
58
|
fsExtra.mkdirSync(output)
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
copyTempFile(tempPath, output)
|
|
60
|
+
copyTempFile(tempInfo.src, output)
|
|
61
61
|
createTempEnd(output)
|
|
62
62
|
creating.succeed()
|
|
63
63
|
}
|