-
Notifications
You must be signed in to change notification settings - Fork 2
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
Convert some parts to async await and simplify #49
Conversation
Change-type: patch
Change-type: patch
bb401ab
to
eb1105c
Compare
target, | ||
getConfigPathDefinition(manifest, CONNECTIONS_FOLDER), |
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.
All that this was doing was setting path=CONNECTIONS_FOLDER
to the result of definitionForImage()
, which we then read in readdirAsync(connectionsFolderDefinition.path);
.
So the reasoning of this refactoring (which I repeat all of the place) was to avoid the extra destructing and make things simpler by directly referencing the CONNECTIONS_FOLDER
in the readdirAsync (9 lines lower), since readdirAsync(CONNECTIONS_FOLDER);
reads easier than readdirAsync(connectionsFolderDefinition.path);
The change in src/utils.ts
is an easier case that also demonstrates the same idea applied here.
|
||
// Fresh image, new format, according to https://github.com/resin-os/meta-resin/pull/770/files | ||
if (_.includes(files, 'resin-sample.ignore')) { | ||
const inputDefinition = utils.definitionForImage( |
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.
Repeats what we did in const connectionsFolderDefinition = utils.definitionForImage()
above, and just sets a different path. Since we no longer access the .path
via this result, we can run definitionForImage()
just once and re-use it in all branches w/ just different inline paths ${CONNECTIONS_FOLDER}/resin-sample.ignore
in this case
Change-type: patch