Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow symlink as input #80

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

allow symlink as input #80

wants to merge 1 commit into from

Conversation

lazdmx
Copy link

@lazdmx lazdmx commented Feb 28, 2020

Previous implementation used 'lstatSync' which returns stat info about link
itself, not the file that it refers to. That behaviour didn't allow to use the
tool in case of separate build (source and build dirs are separate, and sources
linked back into build directory).

As workaround there we could provide file content through stdin, but that
approach has limitations:

  • you cannot process multiple files at once
  • you cannot use 'include' directives

This commit changes the use of 'lstatSync' to 'statSync' which makes symlink
files be processed as expected.

Previous implementation used 'lstatSync'  which returns stat info about link
itself, not the file that it refers to. That behaviour didn't allow to use the
tool in case of separate build (source and build dirs are separate, and sources
linked back into  build directory).

As workaround there we could provide file content through stdin, but that
approach has limitations:
- you cannot process multiple files at once
- you cannot use 'include' directives

This commit changes the use of  'lstatSync' to 'statSync' which makes symlink
files be processed as expected.
@ci-reporter
Copy link

ci-reporter bot commented Feb 28, 2020

The build is failing

✨ Good work on this PR so far! ✨ Unfortunately, the Travis CI build is failing as of 2d6c334. Here's the output:

npm test
> [email protected] test /home/travis/build/pugjs/pug-cli
> mocha -R spec --bail


/home/travis/build/pugjs/pug-cli/node_modules/mocha/bin/mocha:13
const {deprecate} = require('../lib/utils');
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3

I'm sure you can fix it! If you need help, don't hesitate to ask a maintainer of the project!


This comment was automagically generated by ci-reporter. If you see a problem, open an issue here.

svallory pushed a commit to tokilabs/pug3-cli that referenced this pull request Apr 23, 2023
Previous implementation used 'lstatSync'  which returns stat info about link
itself, not the file that it refers to. That behaviour didn't allow to use the
tool in case of separate build (source and build dirs are separate, and sources
linked back into  build directory).

As workaround there we could provide file content through stdin, but that
approach has limitations:
- you cannot process multiple files at once
- you cannot use 'include' directives

This commit changes the use of  'lstatSync' to 'statSync' which makes symlink
files be processed as expected.
svallory added a commit to tokilabs/pug3-cli that referenced this pull request Apr 23, 2023
…#4 from tokilabs/merging-forks)

Here's a list of the merged contributions:

- @Anduh at [anduh/pug-cli](https://github.com/anduh/pug-cli)
  - Update Pug to version 3.0.2 (Closes pugjs#88)
- @anthony-tron at [anthony-tron/pug-cli](https://github.com/anthony-tron/pug-cli)
  - Hot reload of options file and YAML in `-O | --obj` option (Closes pugjs#89)
- @lazdmx at https://github.com/lazdmx/pug-cli
  - Allow symlink as input 2d6c334 (Closes pugjs#80) [2d6c334](lazdmx@2d6c334)
- @funai at [funai/pug-cli](https://github.com/funai/pug-cli)
  - [Allow templates to use YAML front-matter](4d5b6e6)
  - [Inject `extends` from  frontmatter `layout`](4d5b6e6#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R260)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant