esa-cli 0.0.1-beta.5 → 0.0.1-beta.6
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.
|
@@ -12,7 +12,7 @@ import fs from 'fs-extra';
|
|
|
12
12
|
import Template from '../../libs/templates/index.js';
|
|
13
13
|
import { installGit } from '../../libs/git/index.js';
|
|
14
14
|
import { descriptionInput } from '../../components/descriptionInput.js';
|
|
15
|
-
import { generateConfigFile, getProjectConfig, getTemplatesConfig, templateHubPath, updateProjectConfigFile } from '../../utils/fileUtils/index.js';
|
|
15
|
+
import { generateConfigFile, getDirName, getProjectConfig, getTemplatesConfig, templateHubPath, updateProjectConfigFile } from '../../utils/fileUtils/index.js';
|
|
16
16
|
import t from '../../i18n/index.js';
|
|
17
17
|
import logger from '../../libs/logger.js';
|
|
18
18
|
import { quickDeploy } from '../deploy/index.js';
|
|
@@ -44,6 +44,10 @@ export default init;
|
|
|
44
44
|
export function handleInit(argv) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
const { config } = argv;
|
|
47
|
+
// 更新npm包
|
|
48
|
+
const __dirname = getDirName(import.meta.url);
|
|
49
|
+
const projectPath = path.join(__dirname, '../../..');
|
|
50
|
+
execSync('npm install', { stdio: 'ignore', cwd: projectPath });
|
|
47
51
|
if (config !== undefined) {
|
|
48
52
|
yield generateConfigFile(String(config));
|
|
49
53
|
return;
|
|
@@ -105,6 +109,7 @@ export function handleInit(argv) {
|
|
|
105
109
|
if (!projectConfig)
|
|
106
110
|
return logger.notInProject();
|
|
107
111
|
const newPath = process.cwd() + '/' + name;
|
|
112
|
+
console.log(newPath);
|
|
108
113
|
targetPath = newPath;
|
|
109
114
|
if (fs.existsSync(newPath)) {
|
|
110
115
|
logger.error(t('already_exist_file_error').d('Error: The project already exists. It looks like a folder named "<project-name>" is already present in the current directory. Please try the following options: 1. Choose a different project name. 2. Delete the existing folder if it\'s not needed: `rm -rf <project-name>` (use with caution!). 3. Move to a different directory before running the init command.'));
|
package/dist/libs/apiService.js
CHANGED
package/dist/package.json
CHANGED