create-handover 0.1.1 → 0.1.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.mjs +10 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -214,7 +214,16 @@ async function run() {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
if (includeTrpc) {
|
|
217
|
-
|
|
217
|
+
let envExample;
|
|
218
|
+
try {
|
|
219
|
+
envExample = await fs.readFile(envExamplePath, "utf8");
|
|
220
|
+
} catch (error) {
|
|
221
|
+
if (error && error.code === "ENOENT") {
|
|
222
|
+
envExample = "NEXT_PUBLIC_HANDOVER_API_URL=\nNEXT_PUBLIC_HANDOVER_API_KEY=\n";
|
|
223
|
+
} else {
|
|
224
|
+
throw error;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
218
227
|
const withTrpcEnv = `${envExample}\n# Optional tRPC API endpoint placeholder\nNEXT_PUBLIC_TRPC_URL=https://api.example.com/trpc\n`;
|
|
219
228
|
await fs.writeFile(envExamplePath, withTrpcEnv, "utf8");
|
|
220
229
|
|