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

src folder files deleted #37

Open
adamski opened this issue Jan 18, 2019 · 7 comments
Open

src folder files deleted #37

adamski opened this issue Jan 18, 2019 · 7 comments

Comments

@adamski
Copy link

adamski commented Jan 18, 2019

I tried this library, using wrl add <src-package> <dest-project>. It asked me something about remove node_modules, I said yes. I came back and realised the src files had all been deleted. Had to recreate my lib, unfortunately I did it before committing changes. Luckily not too much work got deleted.

The lib is being referenced with "module-name": "file:/", and appears as a symlink in the project's node_modules folder.

@Bessonov
Copy link

This happens to me as I had a symlink to the module due to nohoist in a play monorepo :) this produce a copy loop until I stop it. All files were truncated :D

@whalemare
Copy link

The same behavior. Some comments from authors?

@markelarizaga
Copy link

I have had the same issue where the files in the folder used as src for wml command where deleted. I started using wml because I was having issues with npm link in one of my projects. At the moment of running wml startI had the module linked so during the execution of wml the files on the linked project were deleted.
The solution I found was to ensure that when running wml start I don't have the module npm linked. That way, the files are not deleted anymore.
I don't know how the code is working and whether this is possible or not, but I guess a solution would be that wml checks if the folders to delete are actually symlinked and avoid the removal.
Hope this helps.

@cdaringe
Copy link

so grateful to you all. this was super nutty

@Zaporozhec7
Copy link

Zaporozhec7 commented Jan 15, 2020

Maybe such behaviour worth to add big red alert text at top of Readme? Because usually people not read all library issues before start using it, to see this issue

@sadelbrid
Copy link

sadelbrid commented Aug 27, 2020

I'm having the same issue in my npm monorepo. I'm trying to link one of my monorepo's packages with a node module folder in another package:

wml add ../common ../app/node_modules/common

However when I run wml start, it seems to go in a loop for several seconds, then deletes all files in the src folder and then stops. What the heck is going on?

Edit: clearing the destination folder ended up fixing the issue. Not sure why, but I imagine it had to do with symlinks in the destination.

@bahachammakhi
Copy link

@sadelbrid Thank you for the solution but did you find any solution to exclude this behavior?

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

No branches or pull requests

8 participants