https://infracost.io logo
#general
Title
# general
f

famous-city-17122

08/18/2022, 6:48 AM
Hi! Has anyone had an issue where for the first time merge request for Infracost comment works fine but during the second time this error occurs? fatal: destination path '/tmp/base' already exists and is not an empty directory. Any tip would be appreciated.
b

busy-agent-35515

08/18/2022, 7:28 AM
Hello! Based on our yesterday's discussion, it seems that your local machine already has
/tmp/base
directory after the first run and it's not cleaned up
To mitigate that you could add a last step to the pipeline config to delete this directory
Usually the pipeline job is running in a container, so the directory is located in there, and we don't need to worry about the cleanup as the container gets discarded.
After the line with
infracost comment gitlab
command you can add a new line with something like
- rm -rf /tmp/base
as a last step
FYI, this folder is created on
git clone
step to pull your base branch - it is needed to create a baseline for comparison
f

famous-city-17122

08/18/2022, 8:19 AM
Looks like it worked in that form:
- Remove-Item -Recurse -Force /tmp/base
After the changes are made for existing merge request, will additional comment from Infracost appear?
b

busy-agent-35515

08/18/2022, 8:20 AM
Oh, sorry, I guess Windows should have a different command 🙂
The
infracost comment
command has a
--behavior
flag that supports 3 options:
new
,
update
,
delete-and-new
, where
update
is default. Update means it will update content of its latest comment
If you follow our example, its behavior is set to
update
f

famous-city-17122

08/18/2022, 8:30 AM
I somehow missed this part. Hour by hour I like Infracost more and more 🤓
b

busy-agent-35515

08/18/2022, 8:31 AM
Hope you're enjoying using it 🙂