ymotongpoo / vsc-licenser

License handler extension for Visual Studio Code.
Apache License 2.0
45 stars 40 forks source link

[bug] @FILENAME@ does not substitute on linux #144

Closed Diyou closed 5 months ago

Diyou commented 9 months ago

Runtime environment

Behaviors

Configuring settings.json with "licenser.customHeader": "@FILENAME@ - @PROJECT@\n\nCopyright (c) @YEAR@ @AUTHOR@", on linux writes something like in cpp file

/**
 * @FILENAME@ - MyProject
 *
 * Copyright (c) 2023 Author
 */

Expected behavior

Should print:

/**
 * MyHeader.h - MyProject
 *
 * Copyright (c) 2023 Author
 */

Steps to reproduce the issue

  1. Configure settings.json with licenser.customHeader
  2. Insert license header
Diyou commented 9 months ago

https://github.com/ymotongpoo/vsc-licenser/blob/d182244b563efae3d788a13ff1abf0b2e41b8c56/src/extension.ts#L326

Should probably work without the .win32

Diyou commented 5 months ago

Tested with 1.10.0 and it's still behaving like that.

Diyou commented 5 months ago

Looks like its an error in the Readme. Using %FILE% instead of %FILENAME% works.

ymotongpoo commented 5 months ago

Thanks for reporting. This is a documentation bug. I added the fix to the doc. It should be included in the next release.