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.
Files changed (2) hide show
  1. package/index.mjs +10 -1
  2. 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
- const envExample = await fs.readFile(envExamplePath, "utf8");
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-handover",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Scaffold a new Handover client site — the white-label admin boilerplate for the Handover CMS platform",
5
5
  "type": "module",
6
6
  "bin": {