mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 08:01:38 +00:00
fix(cli): add --extra-includes to improve git sync capabilities
This commit is contained in:
@@ -14,8 +14,6 @@ import workspace, { getActiveWorkspace } from "./workspace.ts";
|
||||
import resource from "./resource.ts";
|
||||
import user from "./user.ts";
|
||||
import variable from "./variable.ts";
|
||||
import lgeacyPush from "./push.ts";
|
||||
import legacyPull from "./pull.ts";
|
||||
import hub from "./hub.ts";
|
||||
import folder from "./folder.ts";
|
||||
import schedule from "./schedule.ts";
|
||||
@@ -45,8 +43,6 @@ export {
|
||||
sync,
|
||||
instance,
|
||||
dev,
|
||||
lgeacyPush,
|
||||
legacyPull,
|
||||
hubPull,
|
||||
pull,
|
||||
push,
|
||||
@@ -142,9 +138,6 @@ let command: any = new Command()
|
||||
})
|
||||
)
|
||||
.command("completions", new CompletionsCommand());
|
||||
if (Number.parseInt(VERSION.replace("v", "").replace(".", "")) > 1700) {
|
||||
command = command.command("push", lgeacyPush).command("pull", legacyPull);
|
||||
}
|
||||
|
||||
export let showDiffs = false;
|
||||
async function main() {
|
||||
|
||||
+16
-9
@@ -798,6 +798,7 @@ export const isWhitelisted = (p: string) => {
|
||||
export async function ignoreF(wmillconf: {
|
||||
includes?: string[];
|
||||
excludes?: string[];
|
||||
extraIncludes?: string[];
|
||||
}): Promise<(p: string, isDirectory: boolean) => boolean> {
|
||||
let whitelist: { approve(file: string): boolean } | undefined = undefined;
|
||||
|
||||
@@ -811,7 +812,9 @@ export async function ignoreF(wmillconf: {
|
||||
(!wmillconf.includes ||
|
||||
wmillconf.includes?.some((i) => minimatch(file, i))) &&
|
||||
(!wmillconf?.excludes ||
|
||||
wmillconf.excludes!.every((i) => !minimatch(file, i)))
|
||||
wmillconf.excludes!.every((i) => !minimatch(file, i))) &&
|
||||
(!wmillconf.extraIncludes ||
|
||||
wmillconf.extraIncludes.some((i) => minimatch(file, i)))
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -1412,9 +1415,7 @@ const command = new Command()
|
||||
log.info("2 actions available, pull and push. Use -h to display help.")
|
||||
)
|
||||
.command("pull")
|
||||
.description(
|
||||
"Pull any remote changes and apply them locally. Use --raw for usage without local state tracking."
|
||||
)
|
||||
.description("Pull any remote changes and apply them locally.")
|
||||
.option(
|
||||
"--fail-conflicts",
|
||||
"Error on conflicts (both remote and local have changes on the same item)"
|
||||
@@ -1440,18 +1441,20 @@ const command = new Command()
|
||||
.option("--include-key", "Include workspace encryption key")
|
||||
.option(
|
||||
"-i --includes <patterns:file[]>",
|
||||
"Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string)"
|
||||
"Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Overrides wmill.yaml includes"
|
||||
)
|
||||
.option(
|
||||
"-e --excludes <patterns:file[]>",
|
||||
"Comma separated patterns to specify which file to NOT take into account."
|
||||
"Comma separated patterns to specify which file to NOT take into account. Overrides wmill.yaml excludes"
|
||||
)
|
||||
.option(
|
||||
"--extra-includes <patterns:file[]>",
|
||||
"Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Useful to still take wmill.yaml into account and act as a second pattern to satisfy"
|
||||
)
|
||||
// deno-lint-ignore no-explicit-any
|
||||
.action(pull as any)
|
||||
.command("push")
|
||||
.description(
|
||||
"Push any local changes and apply them remotely. Use --raw for usage without local state tracking."
|
||||
)
|
||||
.description("Push any local changes and apply them remotely.")
|
||||
.option(
|
||||
"--fail-conflicts",
|
||||
"Error on conflicts (both remote and local have changes on the same item)"
|
||||
@@ -1484,6 +1487,10 @@ const command = new Command()
|
||||
"-e --excludes <patterns:file[]>",
|
||||
"Comma separated patterns to specify which file to NOT take into account."
|
||||
)
|
||||
.option(
|
||||
"--extra-includes <patterns:file[]>",
|
||||
"Comma separated patterns to specify which file to take into account (among files that are compatible with windmill). Patterns can include * (any string until '/') and ** (any string). Useful to still take wmill.yaml into account and act as a second pattern to satisfy"
|
||||
)
|
||||
.option(
|
||||
"--message <message:string>",
|
||||
"Include a message that will be added to all scripts/flows/apps updated during this push"
|
||||
|
||||
Reference in New Issue
Block a user