Mechanic icon indicating copy to clipboard operation
Mechanic copied to clipboard

Only touch the fsproj when things actually changed

Open forki opened this issue 7 years ago • 7 comments

image

we should only overwrite the file if the content changed

forki avatar Mar 13 '18 11:03 forki

Hi @forki :-)

I am newcomer to F# OSS and I would like to help. As I understood, this issue is about saving current fsproj file if any file ordering was applied, am I correct? If so, can this be detected purely using content of fsproj?

dpraimeyuu avatar Mar 13 '18 13:03 dpraimeyuu

yes exactly. I paket we basically load the file into memory and compare with string that would write to disk. If the strings are equal then we skip the writing

forki avatar Mar 13 '18 13:03 forki

Doesn't seem scary though. I will try to do setup this evening

dpraimeyuu avatar Mar 13 '18 13:03 dpraimeyuu

@forki

image

I suppose here (before invoking save fn) the actual checking should be placed, correct?

dpraimeyuu avatar Mar 15 '18 05:03 dpraimeyuu

Yes. Or inside the save function

Damian Płaza [email protected] schrieb am Do., 15. März 2018, 06:39:

@forki https://github.com/forki

[image: image] https://user-images.githubusercontent.com/6437191/37446066-802e605a-281b-11e8-8e4b-ed54cea17889.png

I suppose here (before invoking save fn) the actual checking should be placed, correct?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Mechanic/issues/83#issuecomment-373266909, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNGxdiMc9Kt9d5dZ63MeSSf5a3RWvks5tef6rgaJpZM4SohsR .

forki avatar Mar 15 '18 05:03 forki

Then save fn would do two things: check if save is necessary and true saving. I would place it in mentioned updateProjectFile.

dpraimeyuu avatar Mar 15 '18 05:03 dpraimeyuu

Ok

Damian Płaza [email protected] schrieb am Do., 15. März 2018, 06:52:

Then save fn would do two things: check if save is necessary and true saving. I would place it in mentioned updateProjectFile.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fsprojects/Mechanic/issues/83#issuecomment-373268650, or mute the thread https://github.com/notifications/unsubscribe-auth/AADgNO1EKDnSyxXtiYZ_YQMD-o8K7Rm_ks5tegGdgaJpZM4SohsR .

forki avatar Mar 15 '18 06:03 forki