cmyr-template-cli 1.25.2 → 1.25.3
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/dist/plopfile.js +6 -4
- package/package.json +1 -1
package/dist/plopfile.js
CHANGED
|
@@ -487,10 +487,12 @@ async function init(projectPath, answers) {
|
|
|
487
487
|
});
|
|
488
488
|
await initConfig(projectPath);
|
|
489
489
|
await initCommitizen(projectPath);
|
|
490
|
+
const info = await getProjectInfo(projectPath, answers);
|
|
491
|
+
if (info) {
|
|
492
|
+
await initProjectJson(projectPath, info);
|
|
493
|
+
}
|
|
490
494
|
if (isOpenSource) {
|
|
491
|
-
const info = await getProjectInfo(projectPath, answers);
|
|
492
495
|
if (info) {
|
|
493
|
-
await initProjectJson(projectPath, info);
|
|
494
496
|
if (isInitReadme) {
|
|
495
497
|
await initReadme(projectPath, info);
|
|
496
498
|
}
|
|
@@ -860,7 +862,7 @@ async function getProjectInfo(projectPath, answers) {
|
|
|
860
862
|
var _a, _b, _c, _d, _e, _f;
|
|
861
863
|
const loading = ora__default["default"]('正在获取项目信息 ……').start();
|
|
862
864
|
try {
|
|
863
|
-
const { name, author, description, template, isOpenSource, isPublishToNpm, license, isPrivateScopePackage, scopeName } = answers;
|
|
865
|
+
const { name, author, description, template, isOpenSource, isPublishToNpm, license = 'UNLICENSED', isPrivateScopePackage, scopeName } = answers;
|
|
864
866
|
const templateMeta = getTemplateMeta(template);
|
|
865
867
|
const projectName = name;
|
|
866
868
|
const packageManager = 'npm';
|
|
@@ -895,7 +897,7 @@ async function getProjectInfo(projectPath, answers) {
|
|
|
895
897
|
const licenseUrl = `${repositoryUrl}/blob/master/LICENSE`;
|
|
896
898
|
const discussionsUrl = `${repositoryUrl}/discussions`;
|
|
897
899
|
const pullRequestsUrl = `${repositoryUrl}/pulls`;
|
|
898
|
-
const authorWebsite = await getAuthorWebsiteFromGithubAPI(githubUsername);
|
|
900
|
+
const authorWebsite = isOpenSource ? await getAuthorWebsiteFromGithubAPI(githubUsername) : '';
|
|
899
901
|
const projectInfos = {
|
|
900
902
|
...answers,
|
|
901
903
|
currentYear: new Date().getFullYear(),
|