Skip to content

unstow behaves is differently than stow -D #15

@menghuu

Description

@menghuu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions