@reactful/create 0.0.70 → 0.0.71

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.
Files changed (2) hide show
  1. package/index.js +7 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -41,8 +41,7 @@ inquirer.prompt(questions).then(async function (answers) {
41
41
 
42
42
  renamingJSON(destination, answers.project)
43
43
 
44
- execSync(`cd ${answers.project}`)
45
- execSync(`bun install`)
44
+ execSync(`cd ${answers.project}; bun install`)
46
45
  })
47
46
 
48
47
  function renamingJSON(directory, projectName) {
@@ -60,14 +59,16 @@ function renamingJSON(directory, projectName) {
60
59
  const downloadRepo = async (subfolder, destination) =>
61
60
  downloadGitHub('jsenaribeiro', 'reactful', subfolder, destination)
62
61
 
63
- async function downloadGitHub(user, repository, subfolder, destination) {
62
+ async function downloadGitHub(user, repository, subdir, destination) {
64
63
  const prefix = `https://api.github.com/repos/${user}/${repository}`
65
- const url = `${prefix}/contents/installation/${subfolder}`
64
+ const url = `${prefix}/contents/installation/${subdir}`
66
65
  const contents = await fetch(url).then(x => x.json())
67
66
 
68
- console.log('- url', url)
69
-
70
67
  for (const item of contents) {
68
+ const from = `${subdir}/${item.name}`
69
+ const goto = `${destination}/${item.name}`
70
+
71
+ if (item.type === 'dir') await downloadGitHub(from, goto)
71
72
  if (item.type != 'file') continue
72
73
 
73
74
  const filename = path.join(destination, item.name)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reactful/create",
3
- "version": "0.0.70",
3
+ "version": "0.0.71",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "description": "reactful scafold tool",