[!windows] skip 'Windows only'

unix2dos golden/apply
unix2dos golden/archive

# test that scripts in subdirectories are run in the subdirectory
chezmoi apply --force
cmpenv stdout golden/apply

chezmoi dump
cmp stdout golden/dump

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

chezmoi archive --gzip --output=archive.tar.gz
exec tar -tzf archive.tar.gz
cmp stdout golden/archive

-- golden/apply --
$HOME\dir
-- golden/archive --
dir/
dir/script.cmd
-- golden/dump --
{
  "dir": {
    "type": "dir",
    "name": "dir",
    "perm": 511
  },
  "dir/script.cmd": {
    "type": "script",
    "name": "dir/script.cmd",
    "contents": "@echo %cd%\n"
  }
}
-- home/user/.local/share/chezmoi/dir/run_script.cmd --
@echo %cd%
