@reactful/create 0.0.61 → 0.0.62
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/index.js +2 -21
- package/package.json +1 -1
package/index.js
CHANGED
@@ -32,8 +32,8 @@ const questions = [
|
|
32
32
|
]
|
33
33
|
|
34
34
|
inquirer.prompt(questions).then(async function (answers) {
|
35
|
-
exec(
|
36
|
-
exec(
|
35
|
+
exec(`md ${answers.project}`)
|
36
|
+
exec(`cd ${answers.project}`)
|
37
37
|
|
38
38
|
const destination = path.join(process.cwd(), answers.project)
|
39
39
|
const base = 'https://github.com/jsenaribeiro/reactful/installation/'
|
@@ -57,25 +57,6 @@ function renamingJSON(directory, projectName) {
|
|
57
57
|
fs.writeFileSync(url, JSON.stringify(obj, null, 3))
|
58
58
|
}
|
59
59
|
|
60
|
-
function copyFolder(fromDir, destDir) {
|
61
|
-
if (!fs.existsSync(fromDir))
|
62
|
-
return console.error('Directory not found')
|
63
|
-
|
64
|
-
if (!fs.existsSync(destDir))
|
65
|
-
fs.mkdirSync(destDir)
|
66
|
-
|
67
|
-
const files = fs.readdirSync(fromDir)
|
68
|
-
|
69
|
-
files.forEach(item => {
|
70
|
-
const fromPath = `${fromDir}/${item}`
|
71
|
-
const destPath = `${destDir}/${item}`
|
72
|
-
const isFolder = fs.statSync(fromPath).isDirectory()
|
73
|
-
|
74
|
-
if (isFolder) copyFolder(fromPath, destPath)
|
75
|
-
else fs.copyFileSync(fromPath, destPath)
|
76
|
-
})
|
77
|
-
}
|
78
|
-
|
79
60
|
async function downloadRepo(url, destino) {
|
80
61
|
const resposta = await fetch(url)
|
81
62
|
const conteudo = await resposta.json()
|