The current script ($0) will not be equal to the current file (__FILE__) because the script would typically be a binstub generated by Rubygems: ~/.rbenv/versions/2.6.3/bin/validate-schema
The script name check therefore makes the script unusable in this case. Since I don't see any obvious benefit from it, I suggest removing the check.
Per https://github.com/rbenv/rbenv/issues/1178, the
validate-schema
binary does not work when used as a binstub generated by RubyGems.The problem has to do with https://github.com/brandur/json_schema/blob/3316dfea3b766df2b505f9214fe41e1b06692009/bin/validate-schema#L29.
The issue is that:
The script name check therefore makes the script unusable in this case. Since I don't see any obvious benefit from it, I suggest removing the check.