mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 17:21:12 -03:00
Fix build failures when cmake never used
FISH_BUILD_DIR (nominally, ./build) is created by cmake. If you only check out the project via git and then run `cargo build`, this directory won't exist and many of the tests will fail.
This commit is contained in:
@@ -65,6 +65,9 @@ pub fn popd() {
|
||||
pub fn test_init() -> impl ScopeGuarding<Target = ()> {
|
||||
static DONE: OnceCell<()> = OnceCell::new();
|
||||
DONE.get_or_init(|| {
|
||||
// If we are building with `cargo build` and have build w/ `cmake`, FISH_BUILD_DIR might
|
||||
// not yet exist.
|
||||
std::fs::create_dir_all(env!("FISH_BUILD_DIR")).unwrap();
|
||||
set_current_dir(env!("FISH_BUILD_DIR")).unwrap();
|
||||
{
|
||||
let s = CString::new("").unwrap();
|
||||
|
||||
Reference in New Issue
Block a user