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

Publish directory and recursive settings unexpected behavior #105

Merged
merged 19 commits into from
Nov 1, 2023

Conversation

ejhayes
Copy link
Owner

@ejhayes ejhayes commented Nov 1, 2023

Fixes #65 #104

differing readdir behavior

It appears that the recursive param of readdir differs between local development (mac in my case) and github actions

Local (mac)

$ mkdir -p test1/d0/d1
$ node -e "const readdir = require('fs/promises').readdir; readdir('test1',{recursive: true}).then((res) => console.log(res))"
[ 'd0' ]

GitHub actions:

$ mkdir -p test1/d0/d1
$ node -e "const readdir = require('fs/promises').readdir; readdir('test1',{recursive: true}).then((res) => console.log(res))"
[ 'd0', 'd0/d1' ]

Possibly related to?

When used without the recursive option readdir will only read directories from the top level in both environments.

Incorrect getChartDirs result for nonrecursive config

When recursive set to false the returned value of getChartDirs was a string instead of an array. This caused subsequent iteration to be against a string instead of array

No such file for destPath

Iterating over charts was being done against srcPath instead of destPath. This resulted in a cryptic seeming error message like this:

[Error: ENOENT: no such file or directory, scandir 'publish/templates'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: 'publish/templates'
}

The code in this package was doing something that amounted to this:

cp -r myChartPath myDestPath
ls -l myDestPath/myChartPath

In the above case, there would be no myChartPath under myDestPath, only the contents of myChartPath

Version

Published prerelease version: v0.1.4-next.1

Changelog

🎉 This release contains work from a new contributor! 🎉

Thank you, Rohit Khattar (@rfun), for all your work!

🐛 Bug Fix

🔩 Dependency Updates

Authors: 3

rfun and others added 6 commits October 31, 2023 11:37
…instead of expected array. in addition prepCharts was reading srcPath and then iterating over it instead of iterating over whatever was copied to destPath.
@ejhayes ejhayes added bug Something isn't working patch Increment the patch version when merged labels Nov 1, 2023
@github-actions github-actions bot added documentation Changes only affect the documentation large config code labels Nov 1, 2023
@ejhayes ejhayes merged commit aa9c14d into next Nov 1, 2023
8 of 9 checks passed
@ejhayes ejhayes deleted the fix-publish-dirs branch November 1, 2023 23:00
@github-actions github-actions bot added the prerelease This change is available in a prerelease. label Nov 1, 2023
Copy link

github-actions bot commented Nov 1, 2023

🚀 PR was released in v0.1.4 🚀

@github-actions github-actions bot added released This issue/pull request has been released. and removed prerelease This change is available in a prerelease. labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working code config documentation Changes only affect the documentation large patch Increment the patch version when merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants