Skip to content

File configuration fails with input & output #313

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

Closed
ghost opened this issue Aug 17, 2020 · 7 comments · Fixed by #314
Closed

File configuration fails with input & output #313

ghost opened this issue Aug 17, 2020 · 7 comments · Fixed by #314
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 17, 2020

Hi, I'm running into issues using the CLI when I specify the input or output with a configuration file.

For example, this command & configuration works:
posthtml src/views/*.html -o public -c posthtml.json

posthtml.json

{
  "plugins": {
    "posthtml-modules": {
      "root": "./src/views"
    }
  }
}

But this command & configuration fails (no files are outputted):
posthtml -c posthtml.json

posthtml.json

{
  "input": "src/views/*.html",
  "output": "public",
  "plugins": {
    "posthtml-modules": {
      "root": "./src/views"
    }
  }
}

Am I doing something wrong?

Thank you for your time.

@ghost ghost changed the title File configuration fails with input & plugins File configuration fails with input & output Aug 17, 2020
@Scrum
Copy link
Member

Scrum commented Aug 18, 2020

@ccsaposs Hi, thanks for your feedback, there are indeed a couple of issues with merging configurations.

@Scrum Scrum added the bug label Aug 18, 2020
@Scrum Scrum added this to the 0.7.3 milestone Aug 18, 2020
@giuseppeg
Copy link
Contributor

@Scrum not sure if this is related but one of the recent releases broke input when passed as CLI argument. It seems that now config.input is an array of absolute paths and it doesn't work with fast glob.

@Scrum
Copy link
Member

Scrum commented Aug 18, 2020

@giuseppeg @ccsaposs Yes, there was a massive degradation of functionality according to the configuration resolution, fix it in #314

@Scrum Scrum linked a pull request Aug 18, 2020 that will close this issue
@giuseppeg
Copy link
Contributor

@Scrum no worries! Thank you so much for fixing these quickly - by the way while I appreciate to get the quick fix, with my bug reports I don't want to rush and make pressure on you. For what concerns me it is ok if it takes a little more time to get the fix as I know that many of us do open source in our free time.

@giuseppeg
Copy link
Contributor

giuseppeg commented Aug 18, 2020

@Scrum I tried 0.7.3 and the cli doesn't work yet. Here is how I use it:

posthtml "some/inputFolder/**/*.html" "!**/some/outFolder/**" -r some/inputFolder -a -o some/outFolder

(notice the glob patterns are quoted so that the shell doesn't expand them).

In order for fast-glob to grab those files you shouldn't resolve the path to absolute - you should remove the following line

.map(file => path.join(path.resolve(root), file));

@Scrum
Copy link
Member

Scrum commented Aug 18, 2020

no worries! Thank you so much for fixing these quickly - by the way while I appreciate to get the quick fix, with my bug reports I don't want to rush and make pressure on you. For what concerns me it is ok if it takes a little more time to get the fix as I know that many of us do open source in our free time.

You do not create pressure, I know not by hearsay what it is to wait for an answer or a decision on GitHub and this does not give me joy, I would not want the products of the organization to suffer from this.

Everyone is yours issue this is a small step for our organization in its development, do not hesitate to write or talk about problems, we will always find time to quickly solve your problem

@ghost
Copy link
Author

ghost commented Aug 18, 2020

@Scrum Thank you so much for the quick fix! We've got 0.7.3 up and running & it's working great. We really appreciate your quick response and the work that you've done on this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants