create-moncircle 1.0.1 → 1.0.2
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 +3 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -139,10 +139,7 @@ function writeFreshEnv(values) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
function sdkIsInstalled() {
|
|
142
|
-
|
|
143
|
-
const pkg = JSON.parse(fs.readFileSync(PKG_PATH, "utf-8"))
|
|
144
|
-
return !!(pkg.dependencies?.["@moncircle/sdk"] || pkg.devDependencies?.["@moncircle/sdk"])
|
|
145
|
-
} catch { return false }
|
|
142
|
+
return fs.existsSync(path.join(process.cwd(), "node_modules", "@moncircle", "sdk"))
|
|
146
143
|
}
|
|
147
144
|
|
|
148
145
|
async function main() {
|
|
@@ -191,8 +188,8 @@ async function main() {
|
|
|
191
188
|
console.log(`${GREEN}${BOLD} ✅ .env created successfully!${RESET}\n`)
|
|
192
189
|
}
|
|
193
190
|
|
|
194
|
-
// Auto-install @moncircle/sdk if not in
|
|
195
|
-
if (!sdkIsInstalled()
|
|
191
|
+
// Auto-install @moncircle/sdk if not in node_modules
|
|
192
|
+
if (!sdkIsInstalled()) {
|
|
196
193
|
console.log(` ${YELLOW}Installing @moncircle/sdk...${RESET}`)
|
|
197
194
|
try {
|
|
198
195
|
execSync("npm install @moncircle/sdk --save", { stdio: "inherit", cwd: process.cwd() })
|