@reactful/create 0.0.80 → 0.0.82
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 +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
@@ -62,7 +62,7 @@ const downloadRepo = async (subfolder, destination) =>
|
|
62
62
|
async function downloadGitHub(user, repository, subdir, destination) {
|
63
63
|
const prefix = `https://api.github.com/repos/${user}/${repository}`
|
64
64
|
const response = await fetch(`${prefix}/contents/installation/${subdir}`)
|
65
|
-
const contents = response.json()
|
65
|
+
const contents = await response.json()
|
66
66
|
|
67
67
|
if (!Array.isArray(contents) || !response.ok) {
|
68
68
|
console.error('failed to download scafold from github...')
|
@@ -76,7 +76,11 @@ async function downloadGitHub(user, repository, subdir, destination) {
|
|
76
76
|
const from = `${subdir}/${item.name}`
|
77
77
|
const goto = `${destination}/${item.name}`
|
78
78
|
|
79
|
-
if (item.type === 'dir')
|
79
|
+
if (item.type === 'dir') {
|
80
|
+
await downloadGitHub(from, goto)
|
81
|
+
continue
|
82
|
+
}
|
83
|
+
|
80
84
|
if (item.type != 'file') continue
|
81
85
|
|
82
86
|
const filename = path.join(destination, item.name)
|