aboutsummaryrefslogtreecommitdiff
path: root/src/server/caches.odin
diff options
context:
space:
mode:
authorBrad Lewis <22850972+BradLewis@users.noreply.github.com>2026-02-12 14:38:39 +1100
committerBrad Lewis <22850972+BradLewis@users.noreply.github.com>2026-02-12 14:52:27 +1100
commitb32550a87edcbd71d1084eec76c316161066bb06 (patch)
treee8ad7fd5fd209adca67d6f4a9304da44116f99a1 /src/server/caches.odin
parent92b8c767d233c6556ebf46072f32a02d06277363 (diff)
Update ols to use the new os and filepath packages
Diffstat (limited to 'src/server/caches.odin')
-rw-r--r--src/server/caches.odin17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/server/caches.odin b/src/server/caches.odin
index ff7a422..519ce6c 100644
--- a/src/server/caches.odin
+++ b/src/server/caches.odin
@@ -76,26 +76,13 @@ clear_all_package_aliases :: proc() {
//Go through all the collections to find all the possible packages that exists
find_all_package_aliases :: proc() {
- walk_proc :: proc(info: os.File_Info, in_err: os.Errno, user_data: rawptr) -> (err: os.Errno, skip_dir: bool) {
- data := cast(^[dynamic]string)user_data
-
- if !info.is_dir && filepath.ext(info.name) == ".odin" {
- dir := filepath.dir(info.fullpath, context.temp_allocator)
- if !slice.contains(data[:], dir) {
- append(data, dir)
- }
- }
-
- return in_err, false
- }
-
for k, v in common.config.collections {
pkgs := make([dynamic]string, context.temp_allocator)
- filepath.walk(v, walk_proc, &pkgs)
+ append_packages(v, &pkgs, context.temp_allocator)
for pkg in pkgs {
if pkg, err := filepath.rel(v, pkg, context.temp_allocator); err == .None {
- forward_pkg, _ := filepath.to_slash(pkg, context.temp_allocator)
+ forward_pkg, _ := filepath.replace_path_separators(pkg, '/', context.temp_allocator)
if k not_in build_cache.pkg_aliases {
build_cache.pkg_aliases[k] = make([dynamic]string)
}