Merge branch 'main' into ci-fixes

This commit is contained in:
Mic92
2025-05-13 10:42:50 +00:00
4 changed files with 32 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
{ fetchgit }: { fetchgit }:
fetchgit { fetchgit {
url = "https://git.clan.lol/clan/clan-core.git"; url = "https://git.clan.lol/clan/clan-core.git";
rev = "0989bbca36188a4ac78144aec819dfb231e8bede"; rev = "f512f0a949a53ff08edbd701b8b045f80b1d6b75";
sha256 = "1lmz97pjmp7cf7b1zrz4i0x210qgi41np9600idfj4202hp2pz6y"; sha256 = "0g4mz0xlya218dblkgjy37r4mj28dmd57ywj5qclii2sly4i6vzk";
} }

View File

@@ -43,7 +43,17 @@ else
: :
} }
fi fi
if ! treefmt --fail-on-change --no-cache; then mapfile -t untracked < <(git ls-files --others --exclude-standard)
if [[ ${#untracked[@]} -gt 0 ]]; then
for item in "${untracked[@]}"; do
exclude_args+=("--excludes" "$item")
done
treefmt=(treefmt "${exclude_args[@]}")
else
treefmt=(treefmt)
fi
if ! "${treefmt[@]}" --fail-on-change --no-cache; then
pop pop
exit 1 exit 1
fi fi

View File

@@ -78,7 +78,6 @@ function sleep(ms: number) {
} }
interface InstallMachineProps { interface InstallMachineProps {
name?: string; name?: string;
targetHost?: string | null;
machine: MachineData; machine: MachineData;
} }
const InstallMachine = (props: InstallMachineProps) => { const InstallMachine = (props: InstallMachineProps) => {
@@ -104,7 +103,7 @@ const InstallMachine = (props: InstallMachineProps) => {
if (!curr_uri) { if (!curr_uri) {
return; return;
} }
if (!props.name || !props.targetHost) { if (!props.name) {
return; return;
} }
@@ -266,7 +265,7 @@ const InstallMachine = (props: InstallMachineProps) => {
}} }}
initial={ initial={
getValue(formStore, "1") || { getValue(formStore, "1") || {
target: props.targetHost || "", target: props.machine.machine.deploy?.targetHost || "",
report: false, report: false,
} }
} }
@@ -405,6 +404,9 @@ const MachineForm = (props: MachineDetailsProps) => {
), ),
}, },
}); });
queryClient.invalidateQueries({
queryKey: [activeURI(), "machine", machineName(), "get_machine_details"],
});
return null; return null;
}; };
@@ -661,11 +663,7 @@ const MachineForm = (props: MachineDetailsProps) => {
handleClose={() => setInstallModalOpen(false)} handleClose={() => setInstallModalOpen(false)}
class="min-w-[600px]" class="min-w-[600px]"
> >
<InstallMachine <InstallMachine name={machineName()} machine={props.initialData} />
name={machineName()}
targetHost={getValue(formStore, "machine.deploy.targetHost")}
machine={props.initialData}
/>
</Modal> </Modal>
</> </>
); );

View File

@@ -15,7 +15,19 @@ unstash() {
} }
git stash push --quiet --keep-index --message "pre-commit" git stash push --quiet --keep-index --message "pre-commit"
trap unstash EXIT trap unstash EXIT
treefmt
# always ignore untracked files
mapfile -t untracked < <(git ls-files --others --exclude-standard)
if [[ ${#untracked[@]} -gt 0 ]]; then
for item in "${untracked[@]}"; do
exclude_args+=("--excludes" "$item")
done
treefmt=(treefmt "${exclude_args[@]}")
else
treefmt=(treefmt)
fi
"${treefmt[@]}"
{ {
changed=$(git diff --name-only --exit-code); changed=$(git diff --name-only --exit-code);
status=$?; status=$?;