-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat: add aim-downloader #996
Conversation
Since we only utilize Besides - could you cleanup all windows build related change in this PR? |
3d76d37
to
555b3c3
Compare
e6dfe72
to
3f69aa5
Compare
assert_eq!(untildify("Desktop"), "Desktop"); | ||
assert_eq!(untildify(""), ""); | ||
assert_eq!(untildify("/"), "/"); | ||
// assert_eq!(untildify("~/Desktop/~/Code"), "/User/Untildify/Desktop/"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original implementation used regex to capture the first tilde, then truncate the rest string.
Current implementation does not check if tilde exists in the middle of string, so this case will fail.
since we don't run any integration tests for aim - we can remove the tests dir? |
One more thing, some of the tests require network access to test http handler, for example: |
} | ||
} | ||
|
||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test requires network access
std::fs::remove_file(out_file).unwrap(); | ||
} | ||
|
||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test requires network access and external test file
std::fs::remove_file(out_file).unwrap(); | ||
} | ||
|
||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
assert_eq!(result, expected); | ||
} | ||
|
||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, add ignore
to skip.
std::fs::remove_file(".netrc.test_unit").unwrap(); | ||
} | ||
|
||
#[ignore] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test failed then running on windows in the last step remove_file
call - cannot find the file specified
.
run individually is fine. I suspect race condition with above test considering cargo test
run in parallel.
So move test logic from this test case to previous one, and disable this.
Follow up of #948
As @wsxiaoys suggested in the comment, we can maintain a cuszomized verson of
aim
to keep using it.Luckily,
aim
is MIT license and codebase is not big, so I did following changes:aim-downloader
, copyaim
source code to this cratemain.rs
&driver.rs
, removedskim-navi
dependencemain.rs
provides command-line interface, which is not needed as a libdriver.rs
is only used bymain.rs
, so removedhttp_serve_folder.rs
is only used indriver.rs
, which enablesaim
serve a folder over http. It's useless when aim as a lib, so removed. Also removed its dependence:warpy = "0.3.35"skim-navi
is only used bydriver.rs
and incompatible with windows, so removed:skim-navi = "0.1.10"s3
&ssh
download does not support resume, which is why we use this lib. So they're useless, removed them and related test datauntildify
, another incompatible lib with windows.untildify
is a one-function crate which convert a tilde path to its full path(e.g.~/.ssh
to/home/user/.ssh
). It's also MIT license, so I copied unit tests from its codebase, instead of copying it's implementation, I just re-wrote the function which defined inuntildify.rs
.With these changes, together with the changes from #948 applied in tabby, I'm able to build
tabby
successfully regardless of which build mode.And I'm able to run
download
without issue:Release mode:
Debug mode:
Pending work:
aim
to support http download only? (so we don't check-in unused code)