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

unstow behaves is differently than stow -D #15

Open
menghuu opened this issue Jul 4, 2024 · 0 comments
Open

unstow behaves is differently than stow -D #15

menghuu opened this issue Jul 4, 2024 · 0 comments

Comments

@menghuu
Copy link

menghuu commented Jul 4, 2024

stow --target target source (target dir is empty)then stow -D --target target source
SAME as
dploy stow source target then dploy unstow source target

BUT
stow --target target source then make a dir in dest (target dir is not empty, has a folder which name same as a folder in source) then stow -D --target target source
NOT SAME as
dploy stow source target then make a dir in dest (target dir is not empty, has a folder which name same as a folder in source) then dploy unstow source target

Actually, this doesn't have a big impact, but you should know that they are still different

/tmp/stow
❯ tree -a
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target

5 directories, 5 files
/tmp/stow
❯ stow --target target source
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    ├── aaa -> ../source/aaa
    └── dot-bbb -> ../source/dot-bbb

6 directories, 6 files
/tmp/stow
❯ stow -D --target target source
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target           <------------------------- same as dploy

5 directories, 5 files
/tmp/stow
❯ mkdir target/aaa
/tmp/stow
❯ stow --target target source^C
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    └── aaa

6 directories, 5 files
/tmp/stow
❯ stow --target target source
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    ├── aaa
    │   ├── bbb -> ../../source/aaa/bbb
    │   ├── dot-aaa -> ../../source/aaa/dot-aaa
    │   └── dot-ccc -> ../../source/aaa/dot-ccc
    └── dot-bbb -> ../source/dot-bbb

7 directories, 8 files
/tmp/stow
❯ stow -D --target target source
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    └── aaa              <------------------------- NOT same as dploy

6 directories, 5 files

with dploy

/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target

5 directories, 5 files
/tmp/stow
❯ dploy stow source target
dploy stow: link target/aaa => ../source/aaa
dploy stow: link target/dot-bbb => ../source/dot-bbb
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    ├── aaa -> ../source/aaa
    └── dot-bbb -> ../source/dot-bbb

6 directories, 6 files
/tmp/stow
❯ dploy unstow source target
dploy unstow: unlink target/aaa => ../source/aaa
dploy unstow: unlink target/dot-bbb => ../source/dot-bbb
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target              <------------------------- same as stow

5 directories, 5 files
/tmp/stow
❯ mkdir target/aaa
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    └── aaa

6 directories, 5 files
/tmp/stow
❯ dploy stow source target
dploy stow: link target/aaa/bbb => ../../source/aaa/bbb
dploy stow: link target/aaa/dot-aaa => ../../source/aaa/dot-aaa
dploy stow: link target/aaa/dot-ccc => ../../source/aaa/dot-ccc
dploy stow: link target/dot-bbb => ../source/dot-bbb
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target
    ├── aaa
    │   ├── bbb -> ../../source/aaa/bbb
    │   ├── dot-aaa -> ../../source/aaa/dot-aaa
    │   └── dot-ccc -> ../../source/aaa/dot-ccc
    └── dot-bbb -> ../source/dot-bbb

7 directories, 8 files
/tmp/stow
❯ dploy unstow source target
dploy unstow: unlink target/aaa/bbb => ../../source/aaa/bbb
dploy unstow: unlink target/aaa/dot-aaa => ../../source/aaa/dot-aaa
dploy unstow: unlink target/aaa/dot-ccc => ../../source/aaa/dot-ccc
dploy unstow: unlink target/dot-bbb => ../source/dot-bbb
dploy unstow: remove directory target/aaa
/tmp/stow
❯ tree
.
├── source
│   ├── aaa
│   │   ├── bbb
│   │   ├── dot-aaa
│   │   └── dot-ccc
│   │       ├── bbb
│   │       └── dot-aaa
│   └── dot-bbb
└── target                       <------------------------- NOT same as stow

5 directories, 5 files
/tmp/stow
❯ dploy --version
dploy 0.1.2
/tmp/stow
❯ stow --version
stow (GNU Stow) version 2.4.0
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

1 participant