Folder structure:
etc (dir)
deploy (dir)
src (dir)
config (dir)
dist
├- config (dir)
├- index.js
What I'd like to do is pack up everything except the root config folder and place it in a tar in deploy
. It's important that the dist/config
folder be present in the output. Started with:
tar -czf deploy/deploy.gz --exclude=deploy --exclude="./config/" ./*
$ l ./deploy/deploy0/dist
index.js
router.js
test
But that results in a missing dist/config
. The only way I can get dist/config
to come over is if I don't try to exclude anything named config:
tar -czf deploy/deploy.gz --exclude=deploy ./*
$ l ./deploy/deploy1/dist
config
index.js
router.js
test
OSX and CentOS (dev and build). The man for tar makes me think this is not possible.
I worked around this by just deleting folders I don't want, since this is in a build environment and the files are disposable.