Closed Xouzoura closed 2 weeks ago
Open the branch in Web Editor • VS Code • Insiders
Open Preview
Latest commit: 1ef08c934f7cc93462b14fc2896e870aca450a85
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The changes introduce a new boolean variable is_file_mode
in the lua/hurl/main.lua
file, which checks for a file option in the command options. If a file option is present, it appends a --file-root
option to the command with the current working directory. Additionally, a new function util.has_file_in_opts
is added in lua/hurl/utils.lua
, which verifies the presence of a file path in the options and checks its content for specific keywords.
Files | Change Summary |
---|---|
lua/hurl/main.lua | Added variable local is_file_mode to check for file options and modify the command accordingly. Updated output handling to include checks for the --json flag. |
lua/hurl/utils.lua | Introduced function util.has_file_in_opts(opts) to check for file paths in options and validate them. |
In the burrow, changes sprout,
A file mode to check, no doubt!
With options in hand, we dance and play,
Hurling commands in a clever way.
A hop, a skip, a joyful cheer,
For every file, we hold so dear! 🐇✨
@all-contributors add @Xouzoura for code.
@jellydn
I've put up a pull request to add @Xouzoura! :tada:
Simple change to allow usage of the CWD with hurl to use endpoints that require uploading files.
WHAT
Adding the functionality to use local files of the project with hurl through the
--file-root
command. Exampleshould work now.
Link to issue
WHY
Hurl does not allow by default usage of documents if the path is not specified.
HOW
Adding current path to the hurl if there is a file uploaded (Multipart + file must exist). However modification is needed if there is a need for documents not within the project.
Screenshots (if appropriate):
Types of changes
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes