[windows] skip 'UNIX only'

httpd www

# test that chezmoi sniffs the format of tar files
exec tar -cf www/archive.tar archive/
cp www/archive.tar www/archive
chezmoi apply --force --refresh-externals
cmp $HOME/.dir/dir/file golden/dir/file

# test that chezmoi sniffs the format of tar.bz2 files
exec tar -cjf www/archive.tar.bz2 archive/
cp www/archive.tar.bz2 www/archive
chezmoi apply --force --refresh-externals
cmp $HOME/.dir/dir/file golden/dir/file

# test that chezmoi sniffs the format of tar.gz files
exec tar -czf www/archive.tar.gz archive/
cp www/archive.tar.gz www/archive
chezmoi apply --force --refresh-externals
cmp $HOME/.dir/dir/file golden/dir/file

[!exec:zip] stop 'zip not found in $PATH'

# test that chezmoi sniffs the format of zip files
exec zip -r www/archive.zip archive
cp www/archive.zip www/archive
chezmoi apply --force --refresh-externals
cmp $HOME/.dir/dir/file golden/dir/file

chhome home2/user

# test that chezmoi allows the format to be overridden
cp www/archive.zip www/archive2.tar.gz
chezmoi apply --force
cmp $HOME/.dir/dir/file golden/dir/file

-- archive/dir/file --
# contents of dir/file
-- golden/dir/file --
# contents of dir/file
-- home/user/.local/share/chezmoi/.chezmoiexternal.yaml --
.dir:
  type: archive
  url: "{{ env "HTTPD_URL" }}/archive"
  stripComponents: 1
-- home2/user/.local/share/chezmoi/.chezmoiexternal.yaml --
.dir:
  type: archive
  url: "{{ env "HTTPD_URL" }}/archive2.tar.gz"
  stripComponents: 1
  format: zip
-- www/.keep --
