create-ipro-microfront 1.0.2 → 1.0.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/bin/generate-app.js +7 -7
- package/package.json +1 -1
package/bin/generate-app.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Импорт необходимых зависимостей
|
|
4
4
|
import { join } from "path";
|
|
5
|
-
import {
|
|
5
|
+
import { existsSync, rmSync } from "fs";
|
|
6
6
|
import { execSync } from "child_process";
|
|
7
7
|
|
|
8
8
|
if (process.argv.length < 3) {
|
|
@@ -15,8 +15,8 @@ if (process.argv.length < 3) {
|
|
|
15
15
|
const projectName = process.argv[2]; // Название проекта - ipro-catalog
|
|
16
16
|
const currentPath = process.cwd(); // Текущая директория - Desktop/Projects
|
|
17
17
|
const projectPath = join(currentPath, projectName); // Абсолютный путь - Desktop/Projects/ipro-catalog
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const gitFolderPath = join(projectPath, ".git"); // Путь к папке .git
|
|
19
|
+
const binPath = join(projectPath, "bin"); // Путь к папке bin
|
|
20
20
|
const git_repo = "https://github.com/maxsvst/test-repo.git";
|
|
21
21
|
|
|
22
22
|
// Валидация имени проекта
|
|
@@ -44,14 +44,14 @@ async function main() {
|
|
|
44
44
|
execSync("npm install");
|
|
45
45
|
|
|
46
46
|
console.log("Удаление папки .git...");
|
|
47
|
-
if (
|
|
48
|
-
|
|
47
|
+
if (existsSync(gitFolderPath)) {
|
|
48
|
+
rmSync(gitFolderPath, { recursive: true, force: true });
|
|
49
49
|
console.log("Папка .git удалена.");
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
console.log("Удаление папки bin...");
|
|
53
|
-
if (
|
|
54
|
-
|
|
53
|
+
if (existsSync(binPath)) {
|
|
54
|
+
rmSync(binPath, { recursive: true, force: true });
|
|
55
55
|
console.log("Папка bin удалена.");
|
|
56
56
|
}
|
|
57
57
|
|