Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Build tests
run: cargo test --target ${{ matrix.target }} --no-run
run: cargo test --target ${{ matrix.target }} --no-run -- --test-threads=1

- name: Run tests
run: cargo test --target ${{ matrix.target }} --no-fail-fast
run: cargo test --target ${{ matrix.target }} --no-fail-fast -- --test-threads=1
13 changes: 13 additions & 0 deletions src/package/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ impl PackageIndex {
}

let index_dir = tcli_home.join("index");

let lookup = index_dir.join("lookup.json");
let index = index_dir.join("index.json");
let header = index_dir.join("header.json");

if !index_dir.is_dir() {
fs::create_dir(&index_dir)?;
}

if !lookup.is_file() || !index.is_file() || !header.is_file() {
PackageIndex::sync(tcli_home).await?;
}

let lookup: HashMap<PackageReference, LookupTableEntry> = {
let contents = fs::read_to_string(index_dir.join("lookup.json"))?;
serde_json::from_str(&contents)?
Expand Down