Commit Graph

2195 Commits

Author SHA1 Message Date
Jonathan Turner
fb532f3f4e
Prototype shebang support (#1368)
* Add shebang support to nu.

* Move test file

* Add test for scripts

Co-authored-by: Jason Gedge <jason.gedge@shopify.com>
2020-02-10 08:49:45 -08:00
Jason Gedge
a29d52158e
Do not panic when failing to decode lines from external stdout (#1364) 2020-02-10 07:37:48 -08:00
Jonathan Turner
dc50e61f26 Switch stdin redirect to manual. Add test (#1367) 2020-02-09 22:55:07 -08:00
Ryan Blecher
a2668e3327
Add some nu_source docs for meta.rs (#1366)
* Add some docs for meta.rs

* add better explanation for Span merging

* Add some doc tests - not sure how to get them to run

* get rid of doc comments for the temporary method

* add doc test for is_unknown

* fmt
2020-02-09 18:08:14 -08:00
Jonathan Turner
e606407d79
Add error codes to -c (#1361) 2020-02-08 20:04:53 -08:00
Jonathan Turner
5f4fae5b06 Pipeline sink refactor (#1359)
* Refactor pipeline ahead of block changes. Add '-c' commandline option

* Update pipelining an error value

* Fmt

* Clippy

* Add stdin redirect for -c flag

* Add stdin redirect for -c flag
2020-02-08 18:24:33 -08:00
Jason Gedge
3687603799
Only spawn external once when no $it argument (#1358) 2020-02-08 17:57:05 -08:00
George Tsomlektsis
643b532537
Fixed mv not throwing error when the source path was invalid (#1351)
* Fixed mv not throwing error when the source path was invalid

* Fixed failing test

* Fixed another lint error

* Fix $PATH conflicts in .gitpod.Dockerfile (#1349)

- Use the correct user for gitpod Dockerfile.
- Remove unneeded packages (curl, rustc) from gitpod Dockerfile.

* Added test to check for the error

* Fixed linting error

* Fixed mv not moving files on Windows. (#1342)

Move files correctly in windows.

* Fixed mv not throwing error when the source path was invalid

* Fixed failing test

* Fixed another lint error

* Added test to check for the error

* Fixed linting error

* Changed error message

* Typo and fixed test

Co-authored-by: Sean Hellum <seanhellum45@gmail.com>
2020-02-07 12:40:48 -05:00
George Tsomlektsis
ed86b1fbe8
Fixed mv not moving files on Windows. (#1342)
Move files correctly in windows.
2020-02-07 11:24:01 -05:00
Sean Hellum
44a114111e
Fix $PATH conflicts in .gitpod.Dockerfile (#1349)
- Use the correct user for gitpod Dockerfile.
- Remove unneeded packages (curl, rustc) from gitpod Dockerfile.
2020-02-06 15:20:18 -05:00
Jonathan Turner
812a76d588
Update more futures-preview to futures (#1346) 2020-02-05 20:28:42 -08:00
Alex van de Sandt
e3be849c2a
Futures v0.3 upgrade (#1344)
* Upgrade futures, async-stream, and futures_codec

These were the last three dependencies on futures-preview. `nu` itself
is now fully dependent on `futures@0.3`, as opposed to `futures-preview`
alpha.

Because the update to `futures` from `0.3.0-alpha.19` to `0.3.0` removed
the `Stream` implementation of `VecDeque` ([changelog][changelog]), most
commands that convert a `VecDeque` to an `OutputStream` broke and had to
be fixed.

The current solution is to now convert `VecDeque`s to a `Stream` via
`futures::stream::iter`. However, it may be useful for `futures` to
create an `IntoStream` trait, implemented on the `std::collections` (or
really any `IntoIterator`). If something like this happends, it may be
worthwhile to update the trait implementations on `OutputStream` and
refactor these commands again.

While upgrading `futures_codec`, we remove a custom implementation of
`LinesCodec`, as one has been added to the library. There's also a small
refactor to make the stream output more idiomatic.

[changelog]: https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#030---2019-11-5

* Upgrade sys & ps plugin dependencies

They were previously dependent on `futures-preview`, and `nu_plugin_ps`
was dependent on an old version of `futures-timer`.

* Remove dependency on futures-timer from nu

* Update Cargo.lock

* Fix formatting

* Revert fmt regressions

CI is still on 1.40.0, but the latest rustfmt v1.41.0 has changes to the
`val @ pattern` syntax, causing the linting job to fail.

* Fix clippy warnings
2020-02-05 19:46:48 -08:00
Jonathan Turner
ba1b67c072
Attempt rustup update on each PR (#1345)
* Attempt update on each PR

* Update fmt
2020-02-05 19:28:49 -08:00
Jason Gedge
fa910b95b7
Have from-ssv not fail for header-only inputs (#1334) 2020-02-05 11:54:14 -08:00
Ishan Bhanuka
427bde83f7
Allow cp to overwrite existing files (#1339) 2020-02-05 01:54:05 -05:00
Andrés N. Robalino
7a0bc6bc46
Opt-out unused heim features from sys/ps plugins. (#1335) 2020-02-04 01:51:14 -05:00
Ryan Blecher
c6da56949c
Add support for plugin names containing numbers (#1321)
* Add ability to have numbers in plugin name. Plugin must start with alphabetic char

* remove the first character as alphabetic requirement

* Update cli.rs

Going ahead and changing to plus to prevent issue notryanb found

* Update cli.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-02-01 22:08:38 -08:00
Alex
5b398d2ed2
Adding cross-platform kill command (#1326)
* Adding kill command, unclean code

* Removing old comments

* Added quiet option, supports variable number of ids

* Made it per_item_command, calling commands directly without the shell
2020-02-01 10:46:28 -08:00
Jason Gedge
dcdfa2a866
Improve tests and labeling in FilesystemShell (#1305)
Additional `ls` command tests and better FilesystemShell error and label messages.
2020-02-01 03:34:34 -05:00
Corvus Corax
9474fa1ea5
Improved code in du command (#1320)
Made the code a little easier to read
2020-02-01 03:32:06 -05:00
Shaurya Shubham
49a1385543
Make tests work from directory names with spaces (#1325) 2020-01-31 22:12:56 -08:00
Alex van de Sandt
6427ea2331
Update Cargo.lock for ichwh fix (#1312)
`ichwh@0.3.1` fixes a bug that causes path searches to fail. We update
`Cargo.lock` to fix this.

Resolves #1207
2020-01-31 22:11:42 -08:00
Andrés N. Robalino
3610baa227
Default plugins are independent and called from Nu. (#1322) 2020-01-31 17:45:33 -05:00
Andrés N. Robalino
4e201d20ca
Paths from Nu config take priority over external paths. (#1319) 2020-01-31 14:19:47 -05:00
Sebastian Thiel
1fa21ff056
Exclude images to reduce crate by 3MB (#1316)
Maybe there are more candidates for exclusion, but 'images/'
seemed obviously unnecessary.

Something I started realizing lately is that cargo puts most
of the root directory into the crate archive, causing huge
crates to appear on crates.io.

Now that I am in China, I do seem to notice every kilobyte.
2020-01-31 10:38:26 -05:00
Jonathan Turner
0bbd12e37f
Improve the default help message (#1313) 2020-01-30 20:13:14 -08:00
Shaurya Shubham
7df8fdfb28
Rename the now-deprecated add command docs into insert comm… (#1307) 2020-01-30 08:15:20 -05:00
Shaurya Shubham
6a39cd8546
Add docs for the calc command (#1290) 2020-01-29 08:34:54 -05:00
Shaurya Shubham
dc3370b103
Make a calc command (#1280) 2020-01-29 08:34:36 -05:00
Andrés N. Robalino
ac5ad45783
Pretty Nu print default, pretty print regular secondary as raw flag. (#1302) 2020-01-29 02:46:54 -05:00
chrisr
8ef5c47515
Update cargo flags (#1295)
* Update cargo flags

See https://github.com/nushell/nushell.github.io/issues/29

* Update to suggested flag
2020-01-28 22:44:49 -08:00
Andrés N. Robalino
5b19bebe7d
Isolate environment state changes into Host. (#1296)
Moves the state changes for setting and removing environment variables
into the context's host as opposed to calling `std::env::*` directly
from anywhere else.

Introduced FakeHost to prevent environemnt state changes leaking
between unit tests and cause random test failures.
2020-01-29 00:40:06 -05:00
Joseph T. Lyons
2c529cd849
Fix bug where --with-symlink-targets would not display the targets column (#1300) 2020-01-28 21:36:20 -08:00
Jonathan Turner
407f36af29
Remove unused dep (#1298) 2020-01-29 16:44:03 +13:00
Jonathan Turner
763fcbc137
Bump to 0.9.0 (#1297) 2020-01-29 15:17:02 +13:00
Corvus Corax
7061af712e ls will return error if no files/folders match path/pattern (#1286)
* `ls` will return error if no files/folders match path/pattern

* Revert changes to src/data/files.rs

* Add a name_only flag to dir_entry_dict

Add name_only flag to indicate if the caller only cares about filenames
or wants the whole path

* Update ls changes from feedback

* Little cleanup

* Resolve merge conflicts

* lints
2020-01-29 05:58:31 +13:00
Andrés N. Robalino
9b4ba09c95
Nu env vars from config have higher priority. (#1294) 2020-01-28 02:10:15 -05:00
Joseph T. Lyons
9ec6d0c90e Add --with-symlink-targets option for the ls command that displays a new column for the target files of symlinks (#1292)
* Add `--with-symlink-targets` option for the `ls` command that displays a new column for the target files of symlinks

* Fix clippy warning

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-01-28 19:48:41 +13:00
Andrés N. Robalino
f20a4a42e8
Let's the expander look for tokens from start. (#1293) 2020-01-28 01:03:28 -05:00
Andrés N. Robalino
caa6830184
Baseline environment and configuration work. (#1287) 2020-01-27 22:13:22 -05:00
Jacob Gonzalez
f8be1becf2 Updated rustyline to 6.0.0. Added completion_mode config (#1289)
* Updated rustyline to 6.0.0. Added completion_mode config

* Formatted completion_mode config
2020-01-27 16:41:17 +13:00
Jonathan Turner
af51a0e6f0
Update motto 2020-01-27 16:32:02 +13:00
Ryan Blecher
23d11d5e84 Nu source overview (#1282)
* add some notes into README for more elaboration

* rewrite the overview

* remove unused first line

* add last part about tracing and debugging

* change the wording to make it easier to read

* Add example of metadata system

* Add contact information as other helpful links
2020-01-27 15:55:02 +13:00
Jonathan Turner
6da9e2aced
Upgrade crossterm (#1288)
* WIP

* Finish porting to new crossterm

* Fmt
2020-01-27 15:51:46 +13:00
Jason Gedge
32dfb32741 Switch from subprocess crate to the builtin std::process (#1284)
* Switch from subprocess crate to the builtin std::process

* Update external.rs

* Update external.rs

* Update external.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-01-26 16:03:21 +13:00
Corvus Corax
d48f99cb0e compute directory sizes from contained files and directories (#1250)
* compute directory sizes from contained files and directories

* De-lint

* Revert "De-lint"

This reverts commit 9df9fc07d777014fef8f5749a84b4e52e1ee652a.

* Revert "compute directory sizes from contained files and directories"

This reverts commit d43583e9aa20438bd613f78a36e641c9fd48cae3.

* Nu du command

* Nu du for you

* Add async support

* Lints

* so much bug fixing
2020-01-26 15:43:29 +13:00
Jonathan Turner
35359cbc22
Buffer tables until a timeout or threshold is met (#1283) 2020-01-26 09:09:51 +13:00
Jonathan Turner
b52dbcc8ef
Separate dissimilar tables into separate tables (#1281)
* Allow the table command to stream

* Next part of table view refactor
2020-01-26 07:10:20 +13:00
Shaurya Shubham
4429a75e17 Make ls show only the file name (#1276)
* Make ls show only the file name

* Refactor and remove unwraps

* Put functionality in separate flag
2020-01-26 05:20:33 +13:00
Borimino
583f27dc41 Added attributes to from-xml command (#1272)
* Added attributes to from-xml command

* Added attributes as their own rows

* Removed unneccesary lifetime declarations

* from-xml now has children and attributes side by side

* Fixed tests and linting

* Fixed lint-problem
2020-01-26 05:16:40 +13:00