Simon Goller 19c3570cf9
Allow open to work with 'from ...' block commands (#5049)
* Remove panic from BlockCommands run function

Instead of panicing, the run method now returns an error to prevent
nushell from unexpected termination.

* Add ability to open command to run with blocks

The open command tries to parse the content of the file
if there is a command called 'from (file ending)'.  This works
fine if the command was 'built in' because the run method doesn't
fail in this case.  It did fail on a BlockCommand, though.

This change will first probe if the command contains a block and
evaluate it, if this is the case.  If there is no block, it will run
the command the same way as before.

* Add test open files with BlockCommands

* Update open.rs

* Adjust file type on open with BlockCommand parser

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-04-02 07:52:32 +13:00
..
2022-02-22 11:32:29 -05:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-02-09 16:08:16 -06:00
2022-02-22 11:32:29 -05:00
2022-02-07 14:54:06 -05:00
2022-03-18 12:35:28 -05:00
2022-02-17 06:40:24 -05:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-02-22 11:32:29 -05:00
2022-02-07 14:54:06 -05:00
2022-02-15 20:48:32 -05:00
2022-02-16 12:24:45 -06:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-03-19 10:12:54 +13:00
2022-02-17 06:40:24 -05:00
2022-02-07 14:54:06 -05:00
2022-02-17 06:40:24 -05:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-03-09 05:56:08 -05:00
2022-03-25 20:48:01 +13:00
2022-02-07 14:54:06 -05:00
2022-03-07 20:17:33 -05:00
2022-02-22 11:32:29 -05:00
2022-02-07 14:54:06 -05:00
2022-03-18 12:35:28 -05:00
2022-03-18 12:35:28 -05:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-02-07 14:54:06 -05:00
2022-02-16 12:24:45 -06:00
2022-03-19 10:12:54 +13:00
2022-03-18 06:55:02 +13:00
2022-02-25 13:03:39 -05:00
2022-02-07 14:54:06 -05:00
2022-03-24 16:42:41 +13:00
2022-02-22 11:32:29 -05:00