yalc icon indicating copy to clipboard operation
yalc copied to clipboard

"yalc installations clean" does not remove all installations

Open garyo opened this issue 4 years ago • 11 comments

I expect yalc installations clean to remove all installations in ~/.yalc/installations.json but it doesn't. Here's a demo:

% cat ~/.yalc/installations.json
{
  "@horizon/common": [
    "/c/dss/Product/Horizon/horizon/packages/renderer"
  ],
  "@garyo-test/common": [
    "/tmp/yalc-test/app"
  ]
}
tower1 (/tmp/yalc-test [master])  7:11PM 5328=>
% yalc installations show @garyo-test/common
Installations of package @garyo-test/common:
  /tmp/yalc-test/app
tower1 (/tmp/yalc-test [master])  7:11PM 5329=>
% yalc installations clean @garyo-test/common
tower1 (/tmp/yalc-test [master])  7:11PM 5330=>
% cat ~/.yalc/installations.json
{
  "@horizon/common": [
    "/c/dss/Product/Horizon/horizon/packages/renderer"
  ],
  "@garyo-test/common": [
    "/tmp/yalc-test/app"
  ]
}

As you can see "/tmp/yalc-test/app" is still listed.

garyo avatar Aug 16 '20 23:08 garyo

Have updated the package. You may check if it fixed.

wclr avatar Aug 17 '20 04:08 wclr

Thanks -- I got the update but it still doesn't seem to work for me:

% yalc --version
1.0.0-pre.42
tower1 (~HORIZON/packages [master]) 10:39AM 5407=>
% cat ~/.yalc/installations.json
{
  "@horizon/common": [
    "/c/dss/Product/Horizon/horizon/packages/renderer"
  ],
  "@garyo-test/common": [
    "/tmp/yalc-test/app"
  ]
}
tower1 (~HORIZON/packages [master]) 10:39AM 5408=>
% yalc installations clean @garyo-test/common
tower1 (~HORIZON/packages [master]) 10:39AM 5409=>
% yalc installations show
Installations of package @horizon/common:
  /c/dss/Product/Horizon/horizon/packages/renderer
Installations of package @garyo-test/common:
  /tmp/yalc-test/app
tower1 (~HORIZON/packages [master]) 10:39AM 5410=>
% cat ~/.yalc/installations.json
{
  "@horizon/common": [
    "/c/dss/Product/Horizon/horizon/packages/renderer"
  ],
  "@garyo-test/common": [
    "/tmp/yalc-test/app"
  ]
}
tower1 (~HORIZON/packages [master]) 10:39AM 5410=>
% ls -l ~/.yalc/installations.json
-rw-rw-r-- 1 garyo garyo 141 Aug 16 19:19 /home/garyo/.yalc/installations.json

garyo avatar Aug 17 '20 14:08 garyo

why should it remove the installation /tmp/yalc-test/app doesn't exist?

wclr avatar Aug 17 '20 15:08 wclr

Sorry, I don't understand your question. That directory /tmp/yalc-test/app does exist. I must be missing something obvious I'm sure :-)

garyo avatar Aug 17 '20 15:08 garyo

Why the installation should be clean/removed?

wclr avatar Aug 17 '20 16:08 wclr

Shouldn't yalc installations clean @garyo-test/common remove all installations of @garyo-test/common? I'd expect after running that command that my ~/.yalc/installations.json would look like

{
  "@horizon/common": [
    "/c/dss/Product/Horizon/horizon/packages/renderer"
  ]
}

... in other words, no more mention of @garyo-test/common.

garyo avatar Aug 17 '20 16:08 garyo

No, it removes only broken installations. If package.json/yalc.lock not found.

wclr avatar Aug 17 '20 17:08 wclr

Ah, so to actually remove (unpublish) a package I have to go to the destination(s) first, remove the package from yalc.lock there, and then go back and yalc installations clean? OK. (Actually I tried it -- once I yalc remove in the destination, it also removes it from ~/.yalc/installations.json, so this command isn't even needed.)

I was looking at the doc on the home page which says:

Run yalc installations clean my-package to unpublish a package published with yalc publish

so perhaps I'm just confused about what that means. Maybe that sentence could be clarified for newbies?

garyo avatar Aug 17 '20 19:08 garyo

I agree with @garyo, this should be in the README as it's not common sense to first remove it and then unpublish.

advename avatar Jan 18 '22 11:01 advename

Would it be possible to add a command that removes a package from all installations, if yalc installations clean is not meant to do that?

benface avatar Oct 30 '22 21:10 benface

I just ran into this problem. And I also think it's interesting to use a "clean" to remove the yalc file and clean everything. Many times we add several things and want to "clean everything" to start from scratch. Especially in more complex environments

yardz avatar Feb 28 '24 18:02 yardz