From 7bb18f8cce85dfaaaa4d55d87cf1d72bd05ceac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Iv=C3=A1n?= Date: Sat, 13 Jul 2024 14:56:12 -0600 Subject: [PATCH] cli: Use Meson in Vala checks --- src/cli/main.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/cli/main.js b/src/cli/main.js index 77ca0f791..891cda864 100644 --- a/src/cli/main.js +++ b/src/cli/main.js @@ -352,16 +352,28 @@ async function ci({ filenames }) { const languageId = "vala"; let version = 0; - const file_api = Gio.File.new_for_path(pkg.pkgdatadir).get_child( - "workbench.vala", - ); - file_api.copy( + const template_dir = GLib.getenv("FLATPAK_ID") + ? Gio.File.new_for_path( + `/app/share/${GLib.getenv("FLATPAK_ID")}/langs/vala/template`, + ) + : current_dir.resolve_relative_path("src/langs/vala/template"); + + const api_file = template_dir.get_child("workbench.vala"); + api_file.copy( demo_dir.get_child("workbench.vala"), Gio.FileCopyFlags.OVERWRITE, null, null, ); + const meson_file = template_dir.get_child("meson.build"); + meson_file.copy( + demo_dir.get_child("meson.build"), + Gio.FileCopyFlags.OVERWRITE, + null, + null, + ); + const [contents] = await file_vala.load_contents_async(null); const text = new TextDecoder().decode(contents);