Skip to content

ConfigStep: don't fail copying over existing hook#324

Merged
derrickstolee merged 1 commit into
microsoft:masterfrom
derrickstolee:fsmonitor-second-copy
Feb 5, 2020
Merged

ConfigStep: don't fail copying over existing hook#324
derrickstolee merged 1 commit into
microsoft:masterfrom
derrickstolee:fsmonitor-second-copy

Conversation

@derrickstolee
Copy link
Copy Markdown
Contributor

@derrickstolee derrickstolee commented Feb 5, 2020

I was perusing my logs when I found the following error:

System.IO.IOException: The file 'C:\\_git\\scalar\\src\\.git\\hooks\\query-watchman' already exists.
   at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite)
   at Scalar.Common.FileSystem.PhysicalFileSystem.CopyFile(String sourcePath, String destinationPath, Boolean overwrite) in E:\\A\\_work\\23\\s\\Scalar.Common\\FileSystem\\PhysicalFileSystem.cs:line 75
   at Scalar.Common.Maintenance.ConfigStep.ConfigureWatchmanIntegration() in E:\\A\\_work\\23\\s\\Scalar.Common\\Maintenance\\ConfigStep.cs:line 250

"ErrorMessage":"Failed to configure Watchman integration: The file
'C:\\_git\\scalar\\src\\.git\\hooks\\query-watchman' already exists.

Avoid this issue by overwriting the existing hook. This should work perfectly on Mac, and could still get an exception if someone has a read handle open on Windows, but should be rare. In that case, having the exception in the logs is still useful. (Cc: @kewillford)

Comment thread Scalar.Common/Maintenance/ConfigStep.cs Outdated
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee merged commit 95e4fb4 into microsoft:master Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants