Coder Social home page Coder Social logo

Comments (6)

messense avatar messense commented on August 16, 2024 1

Feel free to send a PR.

from cargo-xwin.

messense avatar messense commented on August 16, 2024 1

LGTM.

from cargo-xwin.

shivaraj-bh avatar shivaraj-bh commented on August 16, 2024

Will a PR here to let XWIN_CACHE_DIR override the for cmake be appreciated?

Edit: CMAKE_CACHE_DIR env should override the <cache-path>

from cargo-xwin.

shivaraj-bh avatar shivaraj-bh commented on August 16, 2024

I am not quite certain about the choice of the name, CMAKE_CACHE_DIR, should it be with XWIN_CMAKE_CACHE_DIR instead?

from cargo-xwin.

messense avatar messense commented on August 16, 2024

Can't we just make it consistent with

cargo-xwin/src/common.rs

Lines 78 to 85 in 28cd46e

let xwin_cache_dir = self.xwin_cache_dir.clone().unwrap_or_else(|| {
dirs::cache_dir()
// If the really is no cache dir, cwd will also do
.unwrap_or_else(|| env::current_dir().expect("Failed to get current dir"))
.join(env!("CARGO_PKG_NAME"))
.join("xwin")
});
fs::create_dir_all(&xwin_cache_dir)?;

so that you can override it via XWIN_CACHE_DIR?

from cargo-xwin.

shivaraj-bh avatar shivaraj-bh commented on August 16, 2024

That was my initial thought as well.

If I have to keep it consistent, how does this look?

For xwin's cache:

        let xwin_cache_dir = self.xwin_cache_dir.clone().unwrap_or_else(|| {
            dirs::cache_dir()
                // If the really is no cache dir, cwd will also do
                .unwrap_or_else(|| env::current_dir().expect("Failed to get current dir"))
                .join(env!("CARGO_PKG_NAME"))
        }).join("xwin");
        fs::create_dir_all(&xwin_cache_dir)?;

For cmake's cache:

        let cmake_cache_dir = self.xwin_cache_dir.clone().unwrap_or_else(|| {
            dirs::cache_dir()
                // If the really is no cache dir, cwd will also do
                .unwrap_or_else(|| env::current_dir().expect("Failed to get current dir"))
                .join(env!("CARGO_PKG_NAME"))
        }).join("cmake");
        fs::create_dir_all(&cmake_cache_dir)?;

from cargo-xwin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.