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

My Whole UI project got deleted πŸ˜©πŸ€¦β€β™‚οΈ #297

Closed
anandchakru opened this issue Dec 25, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@anandchakru
Copy link

anandchakru commented Dec 25, 2023

Please DO NOT DELETE everything in any directory, no matter what configuration/misconfiguration is in build.gradle file. Here is what I had in my build.gradle when this DISASTER happened 😩.

node {
	version = '20.10.0'
	download = true
	workDir = file("${project.projectDir}/my-ui") # should have been nodeProjectDir (instead of workDir)
}

task installNpm(type: NodeTask) {
	dependsOn npmInstall
	script = file("${project.projectDir}/my-ui/build.js")
}

task buildReactUI(type: NodeTask) {
	script = file("${project.projectDir}/my-ui/build.js")
	args = ["run", "build"]
}

task copyReactUI(type: Copy) {
	dependsOn buildReactUI
	from "${project.projectDir}/my-ui/build"
	into "${project.projectDir}/src/main/resources/static/public"
}

processResources {
	dependsOn copyReactUI
}

After I ran gradle clean build, this is what I have in my-ui directory
drwxr-xr-x@ 9 loki staff 288 Dec 24 22:24 node-v20.10.0-darwin-x64

@deepy
Copy link
Member

deepy commented Jan 31, 2024

I'm so sorry that this happened, this is a decision that was made before the project was forked and something we probably should have scrutinized much earlier
The reason this cleanup is in place is to prevent node installations from accumulating and filling up the disk, so while the functionality is probably not going away we absolutely should check that we're only deleting node

@deepy deepy self-assigned this Jan 31, 2024
@deepy deepy added the bug Something isn't working label Jan 31, 2024
@deepy
Copy link
Member

deepy commented Feb 2, 2024

This has been fixed in 7.0.2, we now only delete files that either start with node-v or are in a folder starting with node-v
It's not foolproof but should help prevent worst-case scenarios

@deepy deepy closed this as completed Feb 2, 2024
deepy added a commit that referenced this issue Sep 27, 2024
* 7.x:
  7.1.0
  Add license to POM #319
  Update CHANGELOG
  Support for AIX OS on ppc64
  Drop incorrect node_modules input from documentation and tests
  Remove incorrect node_modules input in pnpm test fixture
  Add support for ARM64 Windows #315
  Update documentation
  NodeSetupTask should not delete general files, only old node versions #297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants