-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexfiltrate.ts
More file actions
51 lines (41 loc) · 1 KB
/
exfiltrate.ts
File metadata and controls
51 lines (41 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import {
copyFile,
glob,
mkdir,
} from 'node:fs/promises';
import {
dirname,
relative,
} from 'node:path';
import {
Build,
} from './src/game/Build.ts';
import versions from './versions.json' with {type: 'json'};
const result = await Build.get_versions(versions);
const {
app_id,
depot_id,
} = versions.game.windows;
const community_resources_path = `/app/steamapps/app_${app_id}/depot_${depot_id}/CommunityResources`;
for (const build of result) {
if (build.currently_installed && build.exfiltrate) {
const {
CommunityResource,
} = build.exfiltrate;
const glob_path = `${community_resources_path}/${CommunityResource}`;
for await (const filepath of glob(glob_path)) {
const exfiltration_filepath = `${
import.meta.dirname
}/data/game/windows/${
build.version
}/${
relative(community_resources_path, filepath)
}`;
await mkdir(dirname(exfiltration_filepath), {
recursive: true,
});
await copyFile(filepath, exfiltration_filepath);
}
}
}
console.table(result);