@edgedev/create-edge-app 1.1.13 → 1.1.14
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/cli.js +29 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -38,6 +38,29 @@ const modifyPackageJson = (repoName) => {
|
|
|
38
38
|
return true
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
const cleanGitignore = (repoName) => {
|
|
42
|
+
try {
|
|
43
|
+
const gitignorePath = path.join(repoName, '.gitignore')
|
|
44
|
+
const gitignoreData = fs.readFileSync(gitignorePath, 'utf-8')
|
|
45
|
+
const lines = gitignoreData.split('\n')
|
|
46
|
+
|
|
47
|
+
const markerIndex = lines.findIndex(line => line.trim() === '# Remove these after install:')
|
|
48
|
+
if (markerIndex !== -1) {
|
|
49
|
+
const cleanedLines = lines.slice(0, markerIndex)
|
|
50
|
+
fs.writeFileSync(gitignorePath, cleanedLines.join('\n'))
|
|
51
|
+
console.log('.gitignore cleaned successfully')
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
console.log('No cleanup marker found in .gitignore')
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
console.error('Failed to clean .gitignore', err)
|
|
59
|
+
return false
|
|
60
|
+
}
|
|
61
|
+
return true
|
|
62
|
+
}
|
|
63
|
+
|
|
41
64
|
const repoName = process.argv[2]
|
|
42
65
|
|
|
43
66
|
const gitCheckoutCommand = `git clone --depth 1 https://github.com/Edge-Marketing-and-Design/edgeApp.git ${repoName}`
|
|
@@ -64,6 +87,12 @@ if (!modifiedPackageJson) {
|
|
|
64
87
|
process.exit(1)
|
|
65
88
|
}
|
|
66
89
|
|
|
90
|
+
console.log(`Cleaning .gitignore for ${repoName}...`)
|
|
91
|
+
const cleanedGitignore = cleanGitignore(repoName)
|
|
92
|
+
if (!cleanedGitignore) {
|
|
93
|
+
process.exit(1)
|
|
94
|
+
}
|
|
95
|
+
|
|
67
96
|
console.log(`Installing dependencies for ${repoName}...`)
|
|
68
97
|
const installedDeps = runCommand(installDependenciesCommand)
|
|
69
98
|
if (!installedDeps) {
|