Commit Graph

2311 Commits

Author SHA1 Message Date
Kevin Del Castillo
18dd009ca8
Unified path expansion under new module and better canonicalize (#1571)
* New 'path' module under nu-cli.
Added normalize and canonicalize method.
Added some unit tests.

* Replace old usages of normalize and canonicalize.

* Fix reading symlinks and existence logic.

* Better explained
2020-04-12 07:05:29 +12:00
Jonathan Turner
c0dda36217
Update CONTRIBUTING.md 2020-04-12 06:54:16 +12:00
Sean Hellum
75b72f844e
Create CONTRIBUTING.md (#998)
* Create CONTRIBUTING.md

* mention gitpod

* Update CONTRIBUTING.md

* mention community supports

* fix capitalization issues
2020-04-12 06:52:53 +12:00
Jonathan Turner
fbddc12c02
Move uptime to being a duration value (#1573) 2020-04-11 19:40:56 +12:00
Jonathan Turner
8e7e8c17e1
Make trash support optional (#1572) 2020-04-11 18:53:53 +12:00
Jonathan Turner
8ac9d781fd
Remove source text where not needed (#1567) 2020-04-10 19:56:48 +12:00
Jonathan Turner
c86cf31aac
some minor improvements and removing dead code (#1563) 2020-04-10 07:48:10 +12:00
Jonathan Turner
2c513d1883
More dep bumps (#1562) 2020-04-09 10:28:20 +12:00
Jonathan Turner
04702530a3
Bump a lot of deps (#1560) 2020-04-07 19:51:17 +12:00
Jonathan Turner
c9f424977e
actually bump version (#1559) 2020-04-07 07:18:47 +12:00
Jonathan Turner
183c8407de
fix nu variable. tweak shells (#1558) 2020-04-07 05:30:54 +12:00
Kevin Del Castillo
d0618b0b32
Enable the use of multiple dots in FS Shell commands (#1547)
Every dot after `..` means another parent directory.
2020-04-06 07:28:56 -04:00
Jonathan Turner
c4daa2e40f
Add experimental new parser (#1554)
Move to an experimental new parser
2020-04-06 19:16:14 +12:00
Jason Gedge
0a198b9bd0
Have FilesystemShell#rm correctly delete symlinks (#1550) 2020-04-05 17:17:52 -04:00
Fahmi Akbar Wildana
6a604491f5
ci(docker-publish): force remove non-executable (#1540) 2020-04-02 04:20:18 +13:00
Jonathan Turner
791f7dd9c3
Bump to 0.12.0 (#1538) 2020-04-01 06:25:21 +13:00
Corvus Corax
a4c1b092ba
Add configurations for table headers (#1537)
* Add configurations for table headers

* lint

Co-authored-by: Amanita-Muscaria <nope>
2020-03-31 12:19:48 +13:00
Jonathan Turner
6e71c1008d
Change get to remove blanks (#1534)
Remove blank values when getting a column of values
2020-03-30 15:36:21 +13:00
Jason Gedge
906d0b920f
A few improvements to du implementation: (#1533)
1. Fixed a bug where `--all` wasn't showing files at the root directories.
2. More use of `Result`'s `map` and `map_err` methods.
3. Making tables be homogeneous so one can, for example, `get directories`.
2020-03-29 21:16:09 -04:00
Jason Gedge
efbf4f48c6
Fix poor message for executable that user doesn't have permissi… (#1535)
Previously, if the user didn't have the appropriate permissions to execute the
binary/script, they would see "command not found", which is confusing.

This commit eliminates the `which` crate in favour of `ichwh`, which deals
better with permissions by not dealing with them at all! This is closer to the
behaviour of `which` in many shells. Permission checks are then left up to the
caller to deal with.
2020-03-29 21:15:55 -04:00
Jason Gedge
2ddab3e8ce Some small improvements to du readability.
Mostly, making more use of `map` and `map_err` in `Result`. One benefit
is that at least one location had duplicated logic for how to map the
error, which is no longer the case after this commit.
2020-03-29 17:03:01 -04:00
Jason Gedge
35dc7438a5 Make use of interruptible stream in various places 2020-03-29 17:03:01 -04:00
Jason Gedge
2a54ee0c54 Introduce InterruptibleStream type.
An interruptible stream can query an `AtomicBool. If that bool is true,
the stream will no longer produce any values.

Also introducing the `Interruptible` trait, which extends any `Stream`
with the `interruptible` function, to simplify the construction and
allow chaining.
2020-03-29 17:03:01 -04:00
Jason Gedge
cad2741e9e Split input and output streams into separate modules 2020-03-29 17:03:01 -04:00
Sam Hedin
ae5f3c8210
WIP: 1486/first row as headers (#1530)
* headers plugin

* Remove plugin

* Add non-functioning headers command

* Add ability to extract headers from first row

* Refactor header extraction

* Rebuild indexmap with proper headers

* Rebuild result properly

* Compiling, probably wrapped too much?

* Refactoring

* Deal with case of empty header cell

* Deal with case of empty header cell

* Fix formatting

* Fix linting, attempt 2.

* Move whole_stream_command(Headers) to more appropriate section

* ... more linting

* Return Err(ShellError...) instead of panic, yield each row instead of entire table

* Insert Column[index] if no header info is found.

* Update error description

* Add initial test

* Add tests for headers command

* Lint test cases in headers

* Change ShellError for headers, Add sample_headers file to utils.rs

* Add empty sheet to test file

* Revert "Add empty sheet to test file"

This reverts commit a4bf38a31d.

* Show error message when given empty table
2020-03-29 15:05:57 +13:00
Jon Grythe Stødle
a5e97ca549
Respect CARGO_TARGET_DIR when set (#1528)
This makes the `binaries` function respect the `CARGO_TARGET_DIR` environment variable when set. If it's not present it falls back to the regular target directory used by Cargo.
2020-03-27 17:13:59 -04:00
Andrew Davis
06f87cfbe8
Add support for removing multiple files at once (#1526) 2020-03-25 16:19:01 -04:00
Jonathan Turner
d4e78c6f47
Improve the rotated row wrap (#1524) 2020-03-25 06:27:16 +13:00
Vanessasaurus
3653400ebc
testing fix to matrix to define all variables (#1522)
there is currently a bug with invalid syntax for some of the
docker build steps, and I think this is because there are build
variables in the matrix that are not defined. This PR will
attempt to resolve this issue by defining all missing variables
for each row in the matrix.

Signed-off-by: vsoch <vsochat@stanford.edu>
2020-03-24 16:20:39 +13:00
Jon Grythe Stødle
81a48d6d0e
Fix '/' and '..' not being valid mv targets (#1519)
* Fix '/' and '..' not being valid mv targets

If `/` or `../` is specified as the destination for `mv`, it will fail with an error message saying it's not a valid destination. This fixes it to account for the fact that `Path::file_name` return `None` when the file name evaluates to `/` or `..`. It will only take the slow(er) path if `Path::file_name` returns `None` in its initial check.

Fixes #1291

* Add test
2020-03-24 14:00:48 +13:00
Jonathan Turner
f030ab3f12
Add experimental auto-rotate (#1516) 2020-03-23 09:55:30 +13:00
Nick Gerace
0dc0c6a10a
Add quickstart option to Docker section in README (#1515) 2020-03-23 09:18:50 +13:00
Jonathan Turner
53c8185af3
Fixes the crash for ps --full in Windows (#1514)
* Fixes the crash for `ps --full` in Windows

* Update ps.rs
2020-03-23 08:28:02 +13:00
Jason Gedge
36b5d063c1
Simplify and improve listing for which. (#1510)
* Simplified implementation
* Show executables, even if the current user doesn't have permissions to
  execute them.
2020-03-22 09:11:39 -04:00
Andrew Davis
a7ec00a037
Add documentation for from-ics and from-vcf (#1509) 2020-03-21 14:50:13 +13:00
Jonathan Turner
918822ae0d
Fix numeric comparison with nothing (#1508) 2020-03-21 11:02:49 +13:00
Andrew Davis
ab5e24a0e7
WIP: Add vcard/ical support (#1504)
* Initial from-ical implementation

* Initial from-vcard implementation

* Rename from-ics and from-vcf for autoconvert

* Remove redundant clones

* Add from-vcf and from-ics tests

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-03-21 08:35:09 +13:00
Jonathan Turner
b5ea522f0e
Add a --full mode to ps (#1507)
* Add a --full mode to ps

* Use a slightly older heim
2020-03-20 20:53:49 +13:00
Jonathan Turner
afa963fd50
Add is_dir check to auto-cd (#1506)
* Add markdown output

* Add is_dir() check
2020-03-20 16:57:36 +13:00
Jonathan Turner
1e343ff00c
Add markdown output (#1503) 2020-03-20 08:18:24 +13:00
Andrés N. Robalino
21a543a901
Make sum plugin as internal command. (#1501) 2020-03-18 18:46:00 -05:00
Jonathan Turner
390deb4ff7
Windows needs to remember auto-cd paths when changing drives (#1500)
* Windows needs to remember auto-cd paths when changing drives

* Windows needs to remember auto-cd paths when changing drives
2020-03-18 15:10:45 +13:00
Andrew Davis
1c4cb30d64
Add documentation for skip and skip-while (#1499) 2020-03-18 14:22:35 +13:00
Jonathan Turner
1ec2ec72b5
Add automatic change directory (#1496)
* Allow automatic cd in cli mode

* Set correct priority for auto-cd and add test
2020-03-18 07:13:38 +13:00
Sosthene-Guedon
0d244a9701
Open fails silently, fix #1493 (#1495)
* Fix #1493

The error was wrongfully discarded

* Run cargo fmt
2020-03-17 17:40:04 +13:00
Andrés N. Robalino
b36d21e76f
Infer types from regular delimited plain text unstructured files. (#1494)
* Infer types from regular delimited plain text unstructured files.

* Nothing resolves to an empty string.
2020-03-16 15:50:45 -05:00
Sosthene-Guedon
d8c4565413
Csv errors (#1490)
* Add error message for csv parsing failures

* Add csv error prettyfier

* Improve readability of the error

Line 2: error is easier to understand than:
Line 2, error

* Remove unnecessary use of the format! macro

Replacing it with .to_string() fixes a clippy warning

* Improve consistency with JSON parsing errors
2020-03-16 12:32:02 -05:00
Jonathan Turner
22ba4c2a2f
Add svg support to to-html (#1492) 2020-03-16 20:19:18 +13:00
Kevin DCR
8d19b21b9f
Custom canonicalize method on Filesystem Shell. (#1485)
* Custom canonicalize method for FilesystemShell.

* Use custom canonicalize method.
Fixed missing import.

* Move function body to already impl body.

* Create test that aims to resolve.
2020-03-16 19:28:18 +13:00
Jonathan Turner
45a3afdc79
Update Cargo.toml 2020-03-16 06:12:28 +13:00