nushell/crates/nu-cli/tests/commands
Sam Hedin ee18f16378
Autoenv rewrite, security and scripting (#2083)
* Add args in .nurc file to environment

* Working dummy version

* Add add_nurc to sync_env command

* Parse .nurc file

* Delete env vars after leaving directory

* Removing vals not working, strangely

* Refactoring, add comment

* Debugging

* Debug by logging to file

* Add and remove env var behavior appears correct

However, it does not use existing code that well.

* Move work to cli.rs

* Parse config directories

* I am in a state of distress

* Rename .nurc to .nu

* Some notes for me

* Refactoring

* Removing vars works, but not done in a very nice fashion

* Refactor env_vars_to_delete

* Refactor env_vars_to_add()

* Move directory environment code to separate file

* Refactor from_config

* Restore env values

* Working?

* Working?

* Update comments and change var name

* Formatting

* Remove vars after leaving dir

* Remove notes I made

* Rename config function

* Clippy

* Cleanup and handle errors

* cargo fmt

* Better error messages, remove last (?) unwrap

* FORMAT PLZ

* Rename whitelisted_directories to allowed_directories

* Add comment to clarify how overwritten values are restored.

* Change list of allowed dirs to indexmap

* Rewrite starting

* rewrite everything

* Overwritten env values tracks an indexmap instead of vector

* Refactor restore function

* Untrack removed vars properly

* Performance concerns

* Performance concerns

* Error handling

* Clippy

* Add type aliases for String and OsString

* Deletion almost works

* Working?

* Error handling and refactoring

* nicer errors

* Add TODO file

* Move outside of loop

* Error handling

* Reworking adding of vars

* Reworking adding of vars

* Ready for testing

* Refactoring

* Restore overwritten vals code

* todo.org

* Remove overwritten values tracking, as it is not needed

* Cleanup, stop tracking overwritten values as nu takes care of it

* Init autoenv command

* Initialize autoenv and autoenv trust

* autoenv trust toml

* toml

* Use serde for autoenv

* Optional directory arg

* Add autoenv untrust command

* ... actually add autoenv untrust this time

* OsString and paths

* Revert "OsString and paths"

This reverts commit e6eedf8824.

* Fix path

* Fix path

* Autoenv trust and untrust

* Start using autoenv

* Check hashes

* Use trust functionality when setting vars

* Remove unused code

* Clippy

* Nicer errors for autoenv commands

* Non-working errors

* Update error description

* Satisfy fmt

* Errors

* Errors print, but not nicely

* Nicer errors

* fmt

* Delete accidentally added todo.org file

* Rename direnv to autoenv

* Use ShellError instead of Error

* Change tests to pass, danger zone?

* Clippy and errors

* Clippy... again

* Replace match with or_else

* Use sha2 crate for hashing

* parsing and error msg

* Refactoring

* Only apply vars once

* if parent dir

* Delete vars

* Rework exit code

* Adding works

* restore

* Fix possibility of infinite loop

* Refactoring

* Non-working

* Revert "Non-working"

This reverts commit e231b85570.

* Revert "Revert "Non-working""

This reverts commit 804092e46a.

* Autoenv trust works without restart

* Cargo fix

* Script vars

* Serde

* Serde errors

* Entry and exitscripts

* Clippy

* Support windows and handle errors

* Formatting

* Fix infinite loop on windows

* Debugging windows loop

* More windows infinite loop debugging

* Windows loop debugging #3

* windows loop #4

* Don't return err

* Cleanup unused code

* Infinite loop debug

* Loop debugging

* Check if infinite loop is vars_to_add

* env_vars_to_add does not terminate, skip loop as test

* Hypothesis: std::env::current_dir() is messing with something

* Hypothesis: std::env::current_dir() is messing with something

* plz

* make clippy happy

* debugging in env_vars_to_add

* Debbuging env_vars_to_add #2

* clippy

* clippy..

* Fool clippy

* Fix another infinite loop

* Binary search for error location x)

* Binary search #3

* fmt

* Binary search #4

* more searching...

* closing in... maybe

* PLZ

* Cleanup

* Restore commented out functionality

* Handle case when user gives the directory "."

* fmt

* Use fs::canonicalize for paths

* Create optional script section

* fmt

* Add exitscripts even if no entryscripts are defined

* All sections in .nu-env are now optional

* Re-read config file each directory change

* Hot reload after autoenv untrust, don't run exitscripts if untrusted

* Debugging

* Fix issue with recursive adding of vars

* Thank you for finding my issues Mr. Azure

* use std::env
2020-07-06 05:34:00 +12:00
..
math Add error for division by zero using "=" (#2002) (#2030) 2020-06-22 08:50:43 +12:00
random Add dice subcommand to random command (#2082) 2020-06-30 16:12:51 +12:00
alias.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
append.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
autoenv_trust.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
autoenv_untrust.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
autoenv.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
cal.rs Add support to allow the week day start in cal to be configured via a flag (#1996) 2020-06-19 05:34:51 +12:00
calc.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
cd.rs Adds a test case for changing drives using drive letter in Windows (#2022) 2020-06-22 07:02:58 +12:00
compact.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
cp.rs When the nushell is located in a path that has a space in it, these tests break, this fixes it (#1944) 2020-06-07 15:50:52 +12:00
default.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
drop.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
each.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
enter.rs Convert open/fetch to stream (#2028) 2020-07-04 07:53:20 +12:00
every.rs Add 'every' command to select (or skip) every nth row (#1992) 2020-06-17 07:58:41 +12:00
first.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
format.rs let format access variables also (#1842) 2020-05-19 16:20:09 +12:00
get.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
group_by.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
headers.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
histogram.rs Added a count column on the histogram command (#1853) 2020-05-20 18:02:36 +12:00
insert.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
is_empty.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
keep_until.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
keep_while.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
keep.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
last.rs Show entire table if number of rows requested for last is greater than table size (#2112) 2020-07-05 13:04:17 +12:00
lines.rs Fix buffering in lines command (#2111) 2020-07-05 12:20:58 +12:00
ls.rs Align tables in "ls -f" (#2105) 2020-07-05 08:17:36 +12:00
merge.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
mkdir.rs Implement an option to show paths made of mkdir. (#1932) 2020-06-06 15:13:38 -04:00
mod.rs Autoenv rewrite, security and scripting (#2083) 2020-07-06 05:34:00 +12:00
mv.rs Simplify mv in FilesystemShell (#1587) 2020-05-12 16:40:45 -04:00
nth.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
open.rs Convert open/fetch to stream (#2028) 2020-07-04 07:53:20 +12:00
parse.rs Simplify parse plugin code. (#1904) 2020-05-28 09:58:06 -04:00
prepend.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
range.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
rename.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
reverse.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
rm.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
save.rs When the nushell is located in a path that has a space in it, these tests break, this fixes it (#1944) 2020-06-07 15:50:52 +12:00
select.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
semicolon.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
skip_until.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
sort_by.rs Show error when trying to sort by invalid column (#1880) 2020-05-25 05:37:08 +12:00
split_by.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
split_column.rs Split split command to sub commands. 2020-05-24 02:02:44 -05:00
split_row.rs Fix warnings and split Scope (#1902) 2020-05-27 16:50:26 +12:00
str_.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
touch.rs Move most of the root package into a subcrate. (#1445) 2020-03-04 13:58:20 -05:00
trim.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
uniq.rs Uniq: --count flag to count occurences (#2017) 2020-06-21 12:22:06 +12:00
update.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00
where_.rs Convert sum command into subcommand of the math command (#2004) 2020-06-18 21:02:01 -05:00
with_env.rs Fix for inconsistency when quoted strings are used with with_env shorthand (#1900) 2020-05-26 15:03:55 -04:00
wrap.rs Pick->Select rename. Integration tests changes. (#1725) 2020-05-07 06:03:43 -05:00