Clarify error message for missing bundle script during bundle installation #1660
      
        
          +41
        
        
          −13
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Note
This post has been edited from the original. Comments prior to this comment refer to the earlier version of this post.
This PR changes the error message produced during bundle installation if a bundle directory does not contain a bundle script (i.e.
./bundle.janetor./bundle/init.janet).To assist with testing, it also adds a new
assert-error-valuemacro totest/helpers.janet.Background
If a user attempts to install a bundle that does not contain a bundle script, the
bundle/installfunction can fail with an error message that does not clearly explain that the error is that this file is missing.The error will occur in
get-bundle-moduleand look like this:Implementation
This PR changes the error message in
get-bundle-moduleto specifically refer to the absence of a bundle script. There are some related clean-ups of thebundle/installlogic (notably,initfileis changed tobscriptto avoid visual confusion withinfofile).To assist with testing, this PR also adds an
assert-error-valuemacro totest/helpers.janetso that tests can check that the error they are expecting is raised as opposed to a different kind of error.