From 6b262b8613f1466aa1b3237cde1e63f1c4495edb Mon Sep 17 00:00:00 2001 From: Service Account Date: Wed, 13 Dec 2023 13:57:24 +0700 Subject: [PATCH] Correct Makefile check extenstions --- Makefile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 2bd96d480c..3ce435571c 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ # Makefile for Jan Electron App - Build, Lint, Test, and Clean +.SHELLFLAGS := -eu -o pipefail -c + # Default target, does nothing all: @echo "Specify a target to run" @@ -21,19 +23,11 @@ endif yarn install yarn build:extensions -# check-file-counts: install-and-build ifeq ($(OS),Windows_NT) powershell -Command "$$tgz_count = (Get-ChildItem -Path electron/pre-install -Filter *.tgz | Measure-Object | Select-Object -ExpandProperty Count); $$dir_count = (Get-ChildItem -Path extensions -Directory | Measure-Object | Select-Object -ExpandProperty Count); if ($$tgz_count -ne $$dir_count) { Write-Host 'Number of .tgz files in electron/pre-install (' + $$tgz_count + ') does not match the number of subdirectories in extension (' + $$dir_count + ')'; exit 1 } else { Write-Host 'Extension build successful' }" else - @tgz_count=$$(find electron/pre-install -name "*.tgz" | wc -l); \ - dir_count=$$(find extension -mindepth 1 -maxdepth 1 -type d | wc -l); \ - if [ $$tgz_count -ne $$dir_count ]; then \ - echo "Number of .tgz files in 'electron/pre-install' ($$tgz_count) does not match the number of subdirectories in 'extension' ($$dir_count)"; \ - exit 1; \ - else - echo "Extension build successful"; - fi + @tgz_count=$$(find electron/pre-install -type f -name "*.tgz" | wc -l); dir_count=$$(find extensions -mindepth 1 -maxdepth 1 -type d | wc -l); if [ $$tgz_count -ne $$dir_count ]; then echo "Number of .tgz files in electron/pre-install ($$tgz_count) does not match the number of subdirectories in extension ($$dir_count)"; exit 1; else echo "Extension build successful"; fi endif dev: check-file-counts