Skip to content

Commit

Permalink
Tools/rename.fsx: prevent non-sudo crash
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Jun 10, 2023
1 parent cd62ebe commit 9ec0efc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Tools/rename.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,12 @@ let rec Rename(dir: DirectoryInfo) : unit =
for file in files do
CheckName file.Name file.FullName

Rename currentDir
try
Rename currentDir
with
| :? UnauthorizedAccessException ->
Console.Error.WriteLine
"Encountered an access-denied error, did you run with root/Administrator privileges?"

exit 3
#endif

0 comments on commit 9ec0efc

Please sign in to comment.