mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 03:26:22 +00:00
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:
parent
e603d7396b
commit
002bbc37b1
1 changed files with 4 additions and 1 deletions
|
@ -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") {
|
||||
let originalFolder = sourceDirectory
|
||||
|
||||
|
|
Loading…
Reference in a new issue