Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-PWD-per-drive 2.0 #14546

Open
wants to merge 114 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
6ca1628
Refactor path handling in DriveToPwdMap
Dec 5, 2024
68bde8d
PWD-per-drive v2, basic implementation, auto_cd/cd OK, overlay, set-e…
Dec 8, 2024
9078c18
Merge branch 'nushell:main' into continue-PWD-per-drive-quote
PegasusPlusUS Dec 8, 2024
61594d9
macOS
PegasusPlusUS Dec 8, 2024
b7928cc
Format
PegasusPlusUS Dec 8, 2024
32ba2e0
Linux unused import warning
Dec 8, 2024
b0aeab9
Refactor to clear role of code segments
Dec 9, 2024
ba9d442
Continue refactoring
Dec 9, 2024
1edb0e7
Refactor done
Dec 9, 2024
d81d0e1
Rename mod as pwd_per_drive, cargo clippy
Dec 9, 2024
f09b494
mod define adjustment
Dec 9, 2024
1b77830
Refactor need_expand and extract_drive_letter
Dec 9, 2024
eb05096
Remove bash_strip_extra_quotes() and cmd_remove_all_double_quotes()
Dec 9, 2024
f8e01d8
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Dec 9, 2024
338fa84
Remove extra mods
pegasusplus Dec 9, 2024
e5dee19
Should include Cargo.lock
pegasusplus Dec 9, 2024
de3e4eb
Cargo fmt
pegasusplus Dec 9, 2024
48bad90
Prevent Clippy within tests on Ubuntu
pegasusplus Dec 9, 2024
1aded9f
Loosen only root path of non exists drive
pegasusplus Dec 9, 2024
ea1b0d9
Cargo fmt --all
pegasusplus Dec 9, 2024
7303d28
Refine test case names, is_dir() ensures ends with '\'
pegasusplus Dec 9, 2024
cad5d82
Restore accidentally changed visiblity of sequence mod
pegasusplus Dec 9, 2024
37469f0
Refine variable name.
Dec 10, 2024
c3b6e9f
Revert cd.rs, it does not need to be modified to use PWD-per-drive, a…
Dec 11, 2024
de83d1a
Cargo fmt
Dec 11, 2024
2b9f6e6
Refactor to create EnvMaintainer trait for interact with Stack/Engine…
Dec 12, 2024
8c59cbf
Refactor to create EnvMaintainer trait for interact with Stack/Engine…
Dec 12, 2024
7cdc328
Adjust test expects
Dec 12, 2024
3e973ed
Adjust test expects
Dec 12, 2024
ed84861
Cargo fmt
Dec 12, 2024
795230f
Follow review comments, and adjust expectation on test results for wi…
Dec 13, 2024
4497b69
Follow review comments, refactor set_pwd() to return Result<(), Shell…
Dec 15, 2024
3e17077
if cfg\!(windows) { ... } else { ... } not very compatible, rollback …
Dec 15, 2024
1e8d6aa
report_shell_error import adjustment, set_pwd() return value adjust.
Dec 15, 2024
b1de373
Remove redundant .to_string(), refactor tests to reduce duplicate cod…
Dec 15, 2024
5699299
Try detect incompatible path format
Dec 15, 2024
1057e64
Fix set_pwd() return Result logic.
Dec 15, 2024
e09a1ce
Rollback retain_result_set_pwd() and fetch_result() design, too compl…
Dec 16, 2024
e1b8108
Refactor result as immutable; test import adjustment
Dec 16, 2024
7fe3cca
Refactor as immutable and not using regex.
Dec 16, 2024
a58d80e
Refactor as not using collect()
Dec 16, 2024
709b3af
Remove refex dependency
Dec 16, 2024
25a2a7a
Adjust import condition fo is_env_var_for_drive.
Dec 16, 2024
a46e139
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Dec 16, 2024
e7455b0
Cargo fmt
Dec 16, 2024
628497d
Merge branch 'continue-PWD-per-drive' of github.com:PegasusPlusUS/nus…
Dec 16, 2024
d7fdf96
Adjust import condition
Dec 16, 2024
3122d91
Test case for cd
Dec 19, 2024
e623224
Merge branch 'main' into continue-PWD-per-drive
PegasusPlusUS Dec 20, 2024
1e6df57
Add auto_cd in eval_external.rs, expand test case for cd to auto_cd, …
Dec 21, 2024
3a69e0e
test case for ls
Dec 21, 2024
8666290
Fix ubuntu clippy prroblem
Dec 21, 2024
41d868f
Fix clippy problem
Dec 21, 2024
6316846
solid clippy problem (clippy on windows seems ignore it) finally fixed
Dec 21, 2024
4f761e7
Add test case for 'save'
Dec 21, 2024
62d78af
Merge branch 'main' into continue-PWD-per-drive
PegasusPlusUS Dec 23, 2024
16dd74c
Update Cargo.toml to resolve conflict
PegasusPlusUS Dec 23, 2024
9370c90
Follow review comments, adjust nu-cli as optional mdule
Dec 26, 2024
66cdd10
Follow review comments, adjust nu-cli as optional mdule
Dec 26, 2024
f696757
Merge branch 'main' into continue-PWD-per-drive
PegasusPlusUS Dec 26, 2024
bdb1d47
Resolve conflicts with 0.101
Dec 27, 2024
24619af
Resolve conflicts with main branch
Dec 27, 2024
4aada60
Resolve conflicts with main
Dec 27, 2024
e4e4fe3
Resolve conflicts with main
Dec 27, 2024
a23ee8b
Clippy
Dec 27, 2024
a9f5f67
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Dec 27, 2024
6833110
It's hard to test watch since it will not stop, and nushell does not …
Jan 7, 2025
9404db3
Simplify script construction to make it much clear what the test do
Jan 7, 2025
f351e46
Resolve conflicts
Jan 7, 2025
4489a0a
Currently only test watch on Windows
Jan 7, 2025
f3e45ff
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Jan 7, 2025
02dfda6
Sync with main
Jan 8, 2025
f6ea18f
Merge branch 'continue-PWD-per-drive' of github.com:PegasusPlusUS/nus…
Jan 8, 2025
b6fa6c9
Sync with main
Jan 8, 2025
cc1553c
Move open,save,utouch to filesystem\
Jan 8, 2025
4dd1ec1
Update mod.rs
Jan 8, 2025
cbdef3a
du test
Jan 10, 2025
2c8a12c
open test
Jan 10, 2025
dbe9943
rm test
Jan 10, 2025
a5778b9
cp test
Jan 10, 2025
10e0742
mkdir test
Jan 10, 2025
9f47153
mv test
Jan 10, 2025
0e7dd5b
touch and test for touch
Jan 10, 2025
d9e15d8
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Jan 10, 2025
e0eafab
watch test on Ubuntu passed.
Jan 10, 2025
9881a8c
Simplify test for watch
Jan 10, 2025
ea4d0a6
Wait 2 more seconds for nonstable CI test at github.
Jan 10, 2025
310fea4
Try use zsh on macOS, bash on other Unix.
Jan 10, 2025
46e5215
Rollback for zsh change.
Jan 11, 2025
0bb95a9
watch on macOS sensitive on create, on Ubuntu sensitive on remove
PegasusPlusUS Jan 11, 2025
137cf3e
create, sleep, remove, sleep, report once, on all OS.
PegasusPlusUS Jan 11, 2025
b5a2c18
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Jan 11, 2025
3cd3c5b
Have to slowdown for unstable CI test result.
PegasusPlusUS Jan 11, 2025
5c7c4fd
Merge branch 'continue-PWD-per-drive' of github.com:PegasusPlusUS/nus…
PegasusPlusUS Jan 11, 2025
ee08f2c
Add some sleep 1sec
Jan 11, 2025
62a6481
Add some sleep 1sec to let CI test more stable.
Jan 11, 2025
cf1b08d
Try to make CI stable.
Jan 11, 2025
f13f9a3
Try to make CI stable.
Jan 11, 2025
d03eb0e
Try to make CI stable.
Jan 11, 2025
21de883
Try to make CI stable.
Jan 11, 2025
d06c27a
Try to make CI stable.
Jan 11, 2025
a9122d2
Try resolve CI stable.
Jan 11, 2025
ff98c31
Update glob_from for filesystem commands
Jan 11, 2025
58791c4
Update test in run_external
Jan 11, 2025
b09ab45
Update test for umv.rs
Jan 11, 2025
9f05727
Rollback path.item absolute logic
Jan 11, 2025
7280ae9
Fix umv test case.
Jan 11, 2025
6ddb0c6
Update umv test to make CI stable.
Jan 11, 2025
4754e08
Fix umv test case.
Jan 11, 2025
9d81d72
Using different drive letter for different file system command test t…
Jan 11, 2025
8fabff3
Fix typo.
Jan 11, 2025
3cf7ff7
Merge branch 'nushell:main' into continue-PWD-per-drive
PegasusPlusUS Jan 11, 2025
83d8d50
Add windows path syntax support for glob.
Jan 12, 2025
e5ff125
Fix powershell script process control for nu watch process. That migh…
Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Prevent Clippy within tests on Ubuntu
  • Loading branch information
pegasusplus committed Dec 9, 2024
commit 48bad903c4e758df7a4a5a1de99c205a746bf11c
5 changes: 2 additions & 3 deletions crates/nu-protocol/src/engine/pwd_per_drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@
}
}

#[cfg(windows)]
#[cfg(test)] // test only for windows
#[cfg(all(windows, test))] // test only for windows
mod tests {
use super::*;

Expand All @@ -168,7 +167,7 @@
let engine_state = EngineState::new();

let rel_path = Path::new("c:.config");
let result = format!(r"{path_str}\.config");

Check warning on line 170 in crates/nu-protocol/src/engine/pwd_per_drive.rs

View workflow job for this annotation

GitHub Actions / fmt-clippy (ubuntu-20.04)

Diff in /home/runner/work/nushell/nushell/crates/nu-protocol/src/engine/pwd_per_drive.rs
assert_eq!(
Some(result.as_str()),
expand_path_with(
Expand All @@ -186,10 +185,10 @@
#[test]
fn test_os_windows_maintainer_set_pwd() {
let mut stack = Stack::new();
let path_str = r"c:\uesrs\nushell";
let path_str = r"c:\users\nushell";
let path = Path::new(path_str);
set_pwd(&mut stack, path);
let engine_state = EngineState::new();

Check warning on line 191 in crates/nu-protocol/src/engine/pwd_per_drive.rs

View workflow job for this annotation

GitHub Actions / fmt-clippy (ubuntu-20.04)

Diff in /home/runner/work/nushell/nushell/crates/nu-protocol/src/engine/pwd_per_drive.rs
assert_eq!(
stack
.get_env_var(
Expand Down
Loading