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 user to set prune yes/no #17

Merged
merged 3 commits into from
May 10, 2021
Merged

allow user to set prune yes/no #17

merged 3 commits into from
May 10, 2021

Conversation

zlafil
Copy link
Contributor

@zlafil zlafil commented May 10, 2021

Allows the user to set a boolean if pruning should be done or not, default true

@jonaskello
Copy link
Member

jonaskello commented May 10, 2021

Looks good. I think we can do one more thing to simplify the code. This part:

// Handle the save parameter, delete or rename the temp-files
// This handling only apply to root.json
if (saveQueryParam === "ifcomplete" || saveQueryParam === "no") {
  if (saveQueryParam === "ifcomplete" && missingFilesResult.missingFiles.length === 0) {
    // some code
  } else {
    // Delete files
  }
}

Would probably be simpler to understand if we do this instead (which I think would be the same?):

// The uploaded files have temp file names so they are not "saved" yet.
// Handle the save parameter, delete or rename the temp-files
if (saveQueryParam === "ifcomplete" && missingFilesResult.missingFiles.length === 0) {
  // This handling only apply to root.json
  // Commit temp files ("save" them)
} else if (saveQueryParam === "no") {
  // Delete the temp-files (do not "save" them)
}

@jonaskello
Copy link
Member

Perhaps we should make a separate PR for the above changes to not mix them with these.

@jonaskello
Copy link
Member

@zlafil Could you also update the changelog in this PR? Add a short description of under the unreleased heading and reference this PR.

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.

None yet

2 participants