Having no files in posts results in crash #6

Open
opened 2023-07-22 20:32:34 +00:00 by xrdawson · 0 comments
xrdawson commented 2023-07-22 20:32:34 +00:00 (Migrated from extrastatic.dev)

We should not crash if there are no files in posts.

yarn run v1.22.19
warning package.json: No license field
$ yarn svekyll-cli build && yarn svekyll-cli finalize
warning package.json: No license field
$ /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/.bin/svekyll-cli build
Unable to find local index.html, loading from node modules
Unable to find local src/Index.svelte, loading from node modules
Unable to find local src/Page.svelte, loading from node modules
Unable to find local src/index.html, loading from node modules
Unable to find local svekyll/svekyll.css, loading from node modules
Found 5 candidates
Generating files
Found 0 published: true
Generating tags
Found 0 published: true
All tags {}
CWD /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll
CWD Got files for static
warning package.json: No license field
$ /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/.bin/svekyll-cli finalize
node:fs:1040
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, rename './build/page/0/index.html' -> './build/index.html'
    at Object.renameSync (node:fs:1040:3)
    at renameIndex (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/svekyll/cli.js:706:6)
    at file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/svekyll-cli.js:19:5 {
  errno: -2,
  syscall: 'rename',
  code: 'ENOENT',
  path: './build/page/0/index.html',
  dest: './build/index.html'
}

Node.js v18.16.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

We should not crash if there are no files in posts. ``` yarn run v1.22.19 warning package.json: No license field $ yarn svekyll-cli build && yarn svekyll-cli finalize warning package.json: No license field $ /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/.bin/svekyll-cli build Unable to find local index.html, loading from node modules Unable to find local src/Index.svelte, loading from node modules Unable to find local src/Page.svelte, loading from node modules Unable to find local src/index.html, loading from node modules Unable to find local svekyll/svekyll.css, loading from node modules Found 5 candidates Generating files Found 0 published: true Generating tags Found 0 published: true All tags {} CWD /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll CWD Got files for static warning package.json: No license field $ /home/chrisdawson/Projects/ExtraStatic/blogs/webiphany-svekyll/node_modules/.bin/svekyll-cli finalize node:fs:1040 handleErrorFromBinding(ctx); ^ Error: ENOENT: no such file or directory, rename './build/page/0/index.html' -> './build/index.html' at Object.renameSync (node:fs:1040:3) at renameIndex (file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/svekyll/cli.js:706:6) at file:///home/chrisdawson/Projects/ExtraStatic/svekyll-cli/svekyll-cli.js:19:5 { errno: -2, syscall: 'rename', code: 'ENOENT', path: './build/page/0/index.html', dest: './build/index.html' } Node.js v18.16.1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
svekyll/svekyll-cli#6
No description provided.