Skip to content

[Shock][CLI] - VIM swp files causing exceptions when site rebuilds #200

@emmanuelrosa

Description

@emmanuelrosa

When using shock serve, editing a source file with the VIM editor triggers a rebuild of the website because VIM's .swp file is detected. static_shock then attempts the rebuild while also including the .swp file, which leads to an exception (since the .swp file really isn't a source file):

⚡ Generating a static site with Static Shock!

⚡ Clearing destination directory
Timing: 0.021s - Clear build directory - Deletes all pre-existing files in the project build directory

⚡ Applying plugins
Timing: 0.004s - Apply plugins - Every plugin configures the pipeline as desired

⚡ Loading layouts and components
Layout: /_includes/layouts/.docs_page.jinja.swp
Unhandled exception:
FileSystemException: Failed to decode data using encoding 'utf-8', path = '/home/emmanuel/projects/test/source/_includes/layouts/.docs_page.jinja.swp'
#0      _File._tryDecode (dart:io/file_impl.dart:707:7)
#1      _File.readAsStringSync (dart:io/file_impl.dart:718:7)
#2      StaticShock._loadLayoutsAndComponents (package:static_shock/src/static_shock.dart:358:27)
<asynchronous suspension>
#3      StaticShock.generateSite (package:static_shock/src/static_shock.dart:243:5)
<asynchronous suspension>
#4      main (file:///home/emmanuel/projects/test/bin/main.dart:25:3)
<asynchronous suspension>
Website build encountered an error during the build (255). Not refreshing pages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions