Skip to content

Commit 321a424

Browse files
committed
⏪ Actually, plugins is silly
1 parent fd4587a commit 321a424

3 files changed

Lines changed: 7 additions & 44 deletions

File tree

src/installer.cet.ts

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -67,58 +67,28 @@ const allCanonicalCetFiles = (files: string[]) =>
6767
const matchCetInitLua = (filePath: string): boolean =>
6868
path.basename(filePath) === CET_MOD_CANONICAL_INIT_FILE;
6969

70-
const notMatchCetInitLua = (filePath: string): boolean =>
71-
path.basename(filePath) !== CET_MOD_CANONICAL_INIT_FILE;
72-
7370
const findCanonicalCetDirs = (fileTree: FileTree): string[] =>
7471
findDirectSubdirsWithSome(CET_MOD_CANONICAL_PATH_PREFIX, matchCetInitLua, fileTree);
7572

76-
const findPluginCetDirs = (fileTree: FileTree): string[] =>
77-
findDirectSubdirsWithSome(CET_MOD_CANONICAL_PATH_PREFIX, notMatchCetInitLua, fileTree);
78-
7973
export const detectCetCanonLayout = (fileTree: FileTree): boolean =>
8074
// don't worry about correctness so much here. if there is one valid cet mod, that is good enough
8175
findCanonicalCetDirs(fileTree).length > 0;
8276

83-
export const detectCetPluginLayout = (fileTree: FileTree): boolean =>
84-
// don't worry about correctness so much here. if there is one valid cet mod, that is good enough
85-
findPluginCetDirs(fileTree).length > 0;
86-
87-
export const cetCanonLayout = (
77+
export const cetLazyLayout = (
8878
api: VortexApi,
8979
_modName: string,
9080
fileTree: FileTree,
9181
): MaybeInstructions => {
92-
const allCanonCetFiles = findCanonicalCetDirs(fileTree).flatMap((namedSubdir) =>
93-
filesUnder(namedSubdir, Glob.Any, fileTree));
82+
const allCetFiles = filesUnder(CET_MOD_CANONICAL_PATH_PREFIX, Glob.Any, fileTree);
9483

95-
if (allCanonCetFiles.length < 1) {
84+
if (allCetFiles.length < 1) {
9685
api.log(`debug`, `No canonical CET files found.`);
9786
return NoInstructions.NoMatch;
9887
}
9988

10089
return {
10190
kind: CetLayout.Canon,
102-
instructions: instructionsForSameSourceAndDestPaths(allCanonCetFiles),
103-
};
104-
};
105-
106-
export const cetPluginLayout = (
107-
api: VortexApi,
108-
_modName: string,
109-
fileTree: FileTree,
110-
): MaybeInstructions => {
111-
const allCanonCetFiles = findPluginCetDirs(fileTree).flatMap((namedSubdir) =>
112-
filesUnder(namedSubdir, Glob.Any, fileTree));
113-
114-
if (allCanonCetFiles.length < 1) {
115-
api.log(`debug`, `No plugin CET files found.`);
116-
return NoInstructions.NoMatch;
117-
}
118-
119-
return {
120-
kind: CetLayout.PluginOnly,
121-
instructions: instructionsForSameSourceAndDestPaths(allCanonCetFiles),
91+
instructions: instructionsForSameSourceAndDestPaths(allCetFiles),
12292
};
12393
};
12494

src/installer.multitype.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ import {
1414
} from "./installer.archive";
1515
import {
1616
detectCetCanonLayout,
17-
cetCanonLayout,
18-
detectCetPluginLayout,
19-
cetPluginLayout,
17+
cetLazyLayout,
2018
} from "./installer.cet";
2119
import {
2220
promptToFallbackOrFailOnUnresolvableLayout,
@@ -89,7 +87,6 @@ export const testForMultiTypeMod: V2077TestFunc = (
8987
fileTree: FileTree,
9088
): Promise<VortexTestResult> => {
9189
const hasCanonCet = detectCetCanonLayout(fileTree);
92-
const hasPluginCet = detectCetPluginLayout(fileTree);
9390
const hasCanonRed4Ext = detectRed4ExtCanonOnlyLayout(fileTree);
9491
const hasBasedirRed4Ext = detectRed4ExtBasedirLayout(fileTree);
9592

@@ -108,7 +105,6 @@ export const testForMultiTypeMod: V2077TestFunc = (
108105
hasAllowedConfigJson,
109106
hasAllowedConfigXml,
110107
hasCanonCet,
111-
hasPluginCet,
112108
hasAllowedREDmods,
113109
hasAllowedRedscript,
114110
hasCanonRed4Ext,
@@ -181,8 +177,7 @@ export const installMultiTypeMod: V2077InstallFunc = async (
181177
//
182178
// Defect: https://github.com/E1337Kat/cyberpunk2077_ext_redux/issues/96
183179
const allInstructionSets: LayoutToInstructions[] = [
184-
cetCanonLayout,
185-
cetPluginLayout,
180+
cetLazyLayout,
186181
red4extBasedirLayout,
187182
red4extCanonLayout,
188183
];

src/installers.layouts.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,8 @@ export const enum AsiLayout {
486486
export const enum CetLayout {
487487
Canon = `
488488
- .\\bin\\x64\\plugins\\cyber_engine_tweaks\\mods\\[modname]\\init.lua
489-
- .\\bin\\x64\\plugins\\cyber_engine_tweaks\\mods\\[modname]\\[any files + subdirs]
490-
`,
491-
PluginOnly = `
492489
- .\\bin\\x64\\plugins\\cyber_engine_tweaks\\mods\\[pluginmod]\\[any files + subdirs]
490+
- .\\bin\\x64\\plugins\\cyber_engine_tweaks\\mods\\[modname]\\[any files + subdirs]
493491
`,
494492
}
495493
export const CET_GLOBAL_INI = path.normalize(`bin/x64/global.ini`);

0 commit comments

Comments
 (0)