-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve copying of PHP and legacy CLI files #94
base: main
Are you sure you want to change the base?
Conversation
042e5b7
to
f19ce9d
Compare
@akalipetis this will conflict with the vendorization work - but I was playing with it anyway, to find an efficient way to check the files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issues in here are:
- There's no need to include a new library (afero) for abstracting the filesystem, we can use
fs.FS
instead - The hash should be computed from the actual file, not from a file containing the hash value - this beats the purpose of checking hashes in the first place
1209f44
to
f0a1218
Compare
e16a11a
to
437f559
Compare
Re.
fs.FS is read only, and ideally we would test writing files, which afero would support. But, we could drop all of the testable FS stuff and just write real temporary files with |
8bef9a8
to
a8aa93c
Compare
bf4e77c
to
793f121
Compare
ab42fb3
to
da20e47
Compare
4db1dae
to
42f9ff8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one last comment, passing around the cacheDir
seems not needed and error prone, is there a reason we went for that?
Apart from that, the code LGTM
2eb70bd
to
f6c29b6
Compare
9dc8b8d
to
f2d3fd0
Compare
ede0ef2
to
4a8ddcf
Compare
- Move 'init' responsibility to the legacy package - Remove unnecessary Debug on wrapper - Remove --phar-path option, but preserve {ENV_PREFIX}PHAR_PATH variable - Remove unnecessary global vars - Add a test
- Check the files on each run - Try to avoid partial writes - Move temporary directory from /tmp to the home directory
4a8ddcf
to
75d4d8c
Compare
This checks the existing PHP, legacy CLI and config.yaml files on every run, and re-copies them if necessary.
f.UncompressedSize64
), and then overwrite if the size does not match..tmp
file first and rename it./tmp
to the user's home directory - as determined byos.UserCacheDir()
.Manual tests:
Closes #92
Closes #47