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

CLI: Fix "reset" script removing .idea directory and add "cleanup" script #18309

Merged
merged 3 commits into from
May 24, 2022

Conversation

okonet
Copy link
Contributor

@okonet okonet commented May 24, 2022

Issue: #18308

What I did

Fix the script to not delete .idea
Fix the wording in case when the user decides not to run the script
Add an additional script to delete **/dist only

How to test

  1. Create .idea dir in the root

  2. Run yarn bootstrap and select reset

  3. After script has run you should still see .idea in the root directory

  4. Run yarn bootstrap and select reset script

  5. Answer No or press Esc when asked "are you sure?"

  6. It should say Cleanup cancelled instead of problem is between keyboard and chair

  7. Run yarn bootstrap and select cleanup script

  8. It should only delete /dist folders inside packages and leave node_modules and other files intact

@nx-cloud
Copy link

nx-cloud bot commented May 24, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 8bdb1cd. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@okonet okonet requested review from shilman and ndelangen May 24, 2022 12:27
@shilman shilman added the maintenance User-facing maintenance tasks label May 24, 2022
@@ -11,8 +11,8 @@ const cleaningProcess = spawn('git', [
'clean',
'-xdf',
'-n',
'--exclude=".vscode"',
'--exclude=".idea"',
'--exclude="/.vscode"',
Copy link
Member

Choose a reason for hiding this comment

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

@okonet Any idea why this is necessary? This seems to be more restrictive than what was there before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without that it would try to match .vscode recursively which would increase the amount of directories it would output dramatically because .vscode is often present in node_modules. With the / it would only match the root directories.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't even think /.vscode is needed here since it's under VCS but I left it in case it contains some user-generated settings.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough, but I was more interested in '--exclude=".idea"', which already existed in the code and was replaced by --exclude="/.idea" which seems more restrictive

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The .idea didn't work for me at all. Thus the fix.

Copy link
Member

Choose a reason for hiding this comment

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

That's my question. Any idea why ".idea" doesn't work but "/.idea" does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really. I would assume it could treat the . as part of regex but I didn't want to spend too much time investigating.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

LGTM

@ndelangen ndelangen merged commit c7f7b79 into next May 24, 2022
@ndelangen ndelangen deleted the fix/cleanup-script-removing-idea branch May 24, 2022 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance User-facing maintenance tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants