Skip to content

Commit

Permalink
Correct Makefile check extenstions
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-service-account committed Dec 13, 2023
1 parent 49a32ff commit d9b4695
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down

0 comments on commit d9b4695

Please sign in to comment.