Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Makes config copying idempotent #70

Merged
merged 1 commit into from
May 11, 2017

Conversation

budnik
Copy link
Contributor

@budnik budnik commented Apr 18, 2017

I need to use few features that not yet merged to master So I fork this buildpack, merge required changes and have following config on heroku:

$ heroku buildpacks
=== my-app Buildpack URLs
1. https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz
2. https://github.com/budnik/heroku-buildpack-static.git

As emberjs includes static buildpack in my setup I'm running this buildpack twice.

Expected behaviour:

nginx.conf.erb from latter version of heroku-buildpack-static overrides former one, w/o affecting binaries.

Actual behaviour

two different nginx.conf.erb is created:
~/bin/config/templates/nginx.conf.erb
~/bin/config/config/templates/nginx.conf.erb

I have explanation why that is happening in commit message.

Given we have following paths:

/bin/ # directory
/scripts/config/my/con/fig.conf

When we are copying directory via `cp -a foo/script/config /bin/config`
We get new file with following path:

/bin/config/my/con/fig.conf

But if we run that script again when '/bin/config/` is already present
we would get another file with path:

/bin/config/config/my/con/fig.conf

This commit makes second and consecutive runs of script overwrite same file
@hone
Copy link
Member

hone commented May 11, 2017

Thanks, looks good to me!

@hone hone merged commit 2a49e82 into heroku:master May 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants