fix: Continue setup even if a file to delete is not found (#663)
* Continue setup even if a file to delete is not found For various reasons, `.gitkeep` may be deleted already. (In my case, even though I followed the [Getting Started](https://quartz.jzhao.xyz) instructions exactly, my first run resulted in an `fatal: 'upstream' does not appear to be a git repository`) If we try to delete `.gitkeep` again and don't ignore `ENOENT`, then the whole setup fails. * Use fs.existsSync
This commit is contained in:
		@@ -113,7 +113,10 @@ export async function handleCreate(argv) {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  await fs.promises.unlink(path.join(contentFolder, ".gitkeep"))
 | 
					  const gitkeepPath = path.join(contentFolder, ".gitkeep")
 | 
				
			||||||
 | 
					  if (fs.existsSync(gitkeepPath)) {
 | 
				
			||||||
 | 
					    await fs.promises.unlink(gitkeepPath)
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  if (setupStrategy === "copy" || setupStrategy === "symlink") {
 | 
					  if (setupStrategy === "copy" || setupStrategy === "symlink") {
 | 
				
			||||||
    let originalFolder = sourceDirectory
 | 
					    let originalFolder = sourceDirectory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user