Skip to content

Commit

Permalink
Improve error message when symlink failed on Windows (#565)
Browse files Browse the repository at this point in the history
Resolves #556
  • Loading branch information
straight-shoota committed Dec 23, 2022
1 parent 603ac12 commit f80f39e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/cli.cr
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,17 @@ rescue ex : Shards::ParseError
rescue ex : Shards::Error
Shards::Log.error { ex.message }
exit 1
rescue exc : File::AccessDeniedError
{% if flag?(:windows) %}
if exc.os_error == WinError::ERROR_PRIVILEGE_NOT_HELD && exc.message.try &.starts_with?("Error creating symlink")
Shards::Log.error { <<-TXT }
#{exc}
Shards needs symlinks to work. Please make sure to enable developer mode:
https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development
TXT
exit 1
end
{% end %}
raise exc
end

0 comments on commit f80f39e

Please sign in to comment.