Skip to content

Commit

Permalink
add path
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Dec 9, 2024
1 parent 5ca2f92 commit 4fdd3d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions vm/framework/move-stdlib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ sha3 = "0.9.1"
smallvec = "1.6.1"
include_dir = { workspace = true }
once_cell = { workspace = true }
tempfile = { workspace = true }

[dev-dependencies]
dir-diff = "0.3.2"
Expand Down
8 changes: 6 additions & 2 deletions vm/framework/move-stdlib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ use once_cell::sync::Lazy;
pub const MOVE_STDLIB_SOURCES_DIR: Dir = include_dir!("sources");

pub static MOVE_STDLIB_SOURCE_FILES: Lazy<Vec<String>> = Lazy::new(|| {
let tempdir = tempfile::tempdir().expect("local dir should be created");
let sources_dir = tempdir.path().join("move-stdlib").join("sources");
MOVE_STDLIB_SOURCES_DIR
.files()
.iter()
.filter_map(|file| {
let ext = file.path().extension();
if let Some(ext) = ext {
if ext == "move" {
Some(file.path().display().to_string())
Some(sources_dir.join(file.path()).display().to_string())
} else {
None
}
Expand All @@ -31,14 +33,16 @@ pub static MOVE_STDLIB_SOURCE_FILES: Lazy<Vec<String>> = Lazy::new(|| {
pub const STARCOIN_STDLIB_SOURCES_DIR: Dir = include_dir!("../starcoin-stdlib/sources");

pub static STARCOIN_STDLIB_SOURCE_FILES: Lazy<Vec<String>> = Lazy::new(|| {
let tempdir = tempfile::tempdir().expect("local dir should be created");
let sources_dir = tempdir.path().join("move-stdlib").join("sources");
STARCOIN_STDLIB_SOURCES_DIR
.files()
.iter()
.filter_map(|file| {
let ext = file.path().extension();
if let Some(ext) = ext {
if ext == "move" {
Some(file.path().display().to_string())
Some(sources_dir.join(file.path()).display().to_string())
} else {
None
}
Expand Down

0 comments on commit 4fdd3d2

Please sign in to comment.