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

Fix countFiles when directory does not exist #2142

Merged

Conversation

SanjulaGanepola
Copy link
Member

@SanjulaGanepola SanjulaGanepola commented Jun 26, 2024

Changes

The countFiles function ends up counting the number of files in the home directory when the directory that it is given does not exist. Although I have not noticed any issue in Code4i because of this, it causes an issue in Project Explorer (as it calls getDeployCompareFiles) where it shows that it is going to delete the contents of my home directory:

image

Without this fix, the issue can also be observed in the updated test where the countFiles result ends up counting the number of files in my home directory rather than the directory provided:

image

How to test this PR

  1. Use the test case provided
  2. Use Project Explorer:
  • Deploy your workspace
  • Delete the deploy location using the IFS browser
  • Refresh the source in the Project Explorer and observe the contents of the home directory is not visible unlike the first image above

Checklist

  • have tested my change
  • have created one or more test cases

@worksofliam worksofliam self-requested a review June 26, 2024 19:35
Copy link
Contributor

@worksofliam worksofliam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and test is passing. Thanks!

@worksofliam worksofliam merged commit fea4a69 into codefori:master Jul 1, 2024
1 check passed
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.

2 participants