Igniter `Proceed with changes` message when there is no changes
Hi, as you see this is my simple code for igniter, i am using
update_file
function, because before it i have a function that ensure_package_json_exists
.
I do not know why it shows me even there is not changes Proceed with changes?
It is is my bug?
I tried to use create_or_update_file
function, but if file exist and there is not anything to change, it still shows Proceed with changes?
Another question is when i use create_or_update_file
i should give the address of file, but sometimes the file dose not exist yet in my disk, for example i created it before this function and this file exists in my igniter var and still is not written.
what should i do for this?
thank you in advance
9 Replies
Solution
I think the latest version of igniter may have a fix for this?
I am using last version
0.6.1
, i think 🙂Well, the latest is 0.6.2
My bad yes it is 0.6.2, and has this problem too unfortunately
What happens if you commit everything first to not trigger that git warning?

I committed all the changes first and run the mix again
Source: https://github.com/mishka-group/mishka_chelekom/blob/bea641fd30a1a60359be87943cbafcbae6f1233b/lib/mix/tasks/mishka.assets.deps.ex#L126-L156
Try checking if the new content is the same as the old content manually:
No it is not
contents equal?: false
🥲 , i think i need to rest 😂
Original:
Formatted
What a mistake I made. This was unbelievable. 🚑
original_content has an extra \n (newline) at the very end of the string
formatted does not have that trailing newline
so much sorry to waste your time
i fixed it with. :))
---
Could you please help me in this?
Another question is when i use create_or_update_file
i should give the address of file, but sometimes the file dose not exist yet in my disk, for example i created it before this function and this file exists in my igniter var and still is not written.
what should i do for this?
Aha i can use something like this