Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No more typia patch command required #1510

Merged
merged 1 commit into from
Feb 23, 2025
Merged
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
30 changes: 11 additions & 19 deletions src/executable/TypiaSetupWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,18 @@ export namespace TypiaSetupWizard {
data.scripts ??= {};
if (
typeof data.scripts.prepare === "string" &&
data.scripts.prepare.trim().length
data.scripts.prepare.trim().length !== 0
) {
if (
data.scripts.prepare.indexOf("ts-patch install") === -1 &&
data.scripts.prepare.indexOf("typia patch") === -1
)
data.scripts.prepare =
"ts-patch install && typia patch && " + data.scripts.prepare;
else if (data.scripts.prepare.indexOf("ts-patch install") === -1)
if (data.scripts.prepare.includes("ts-patch install") === false)
data.scripts.prepare = "ts-patch install && " + data.scripts.prepare;
else if (data.scripts.prepare.indexOf("typia patch") === -1)
data.scripts.prepare = data.scripts.prepare.replace(
"ts-patch install",
"ts-patch install && typia patch",
);
} else data.scripts.prepare = "ts-patch install && typia patch";
} else data.scripts.prepare = "ts-patch install";

// NO MORE "typia patch" REQUIRED
data.scripts.prepare = data.scripts.prepare
.split("&&")
.map((str) => str.trim())
.filter((str) => str !== "typia patch")
.join(" && ");

// FOR OLDER VERSIONS
if (typeof data.scripts.postinstall === "string") {
Expand Down Expand Up @@ -100,11 +96,7 @@ export namespace TypiaSetupWizard {
name: name,
message: message,
choices: choices,
...(filter
? {
filter,
}
: {}),
...(filter ? { filter } : {}),
})
)[name];
};
Expand Down
Loading