<commit_before>.PHONY: dist clean copyIcons buildWorkflow release linkSourceFoldersToWorkflow

distDir=./dist
workflowName="Package Managers.alfredworkflow"

dist: | composer copySources copyIcons buildWorkflow
clean:
	rm -rf $(distDir)/*


composer:
	rm -rf vendor
	composer install -v -o --no-dev

copySources:
	$(shell [ ! -d "$(distDir)" ] && mkdir -p "$(distDir)")
	cp -frv bin $(distDir)
	cp -frv src $(distDir)
	cp -fv composer.* $(distDir)
	cp -frv icon-cache $(distDir)
	cp -frv vendor $(distDir)

copyIcons:
	-[[ "${ALFRED_PKGMAN_WORKFLOW_DIR}" == "" ]] && { echo "ALFRED_PKGMAN_WORKFLOW_DIR is not set! Aborting!"; exit 1; }
	find "${ALFRED_PKGMAN_WORKFLOW_DIR}" -type f -name "*.png" -depth 1 -exec cp -fv {} $(distDir) \;

buildWorkflow:
	-[[ "${ALFRED_PKGMAN_WORKFLOW_DIR}" == "" ]] && { echo "ALFRED_PKGMAN_WORKFLOW_DIR is not set! Aborting!"; exit 1; }
	cp -fv "${ALFRED_PKGMAN_WORKFLOW_DIR}"/info.plist $(distDir)
	cd $(distDir) && zip -r $(workflowName) * -x "*.DS_Store"

release: | dist
	cp -fv $(distDir)/info.plist .
	cp -fv $(distDir)/$(workflowName) .


linkSourceFoldersToWorkflow:
	-[[ "${ALFRED_PKGMAN_WORKFLOW_DIR}" == "" ]] && { echo "ALFRED_PKGMAN_WORKFLOW_DIR is not set! Aborting!"; exit 1; }

	-[ -d "${ALFRED_PKGMAN_WORKFLOW_DIR}/bin" ] && mv -v "${ALFRED_PKGMAN_WORKFLOW_DIR}/bin" "${ALFRED_PKGMAN_WORKFLOW_DIR}/bin.bak"<commit_msg>Use absolute path for find command<commit_after>.PHONY: dist clean copyIcons buildWorkflow release linkSourceFoldersToWorkflow

distDir=./dist
workflowName="Package Managers.alfredworkflow"

dist: | composer copySources copyIcons buildWorkflow
clean:
	rm -rf $(distDir)/*


composer:
	rm -rf vendor
	composer install -v -o --no-dev

copySources:
	$(shell [ ! -d "$(distDir)" ] && mkdir -p "$(distDir)")
	cp -frv bin $(distDir)
	cp -frv src $(distDir)
	cp -fv composer.* $(distDir)
	cp -frv icon-cache $(distDir)
	cp -frv vendor $(distDir)

copyIcons:
	-[[ "${ALFRED_PKGMAN_WORKFLOW_DIR}" == "" ]] && { echo "ALFRED_PKGMAN_WORKFLOW_DIR is not set! Aborting!"; exit 1; }
	/usr/bin/find "${ALFRED_PKGMAN_WORKFLOW_DIR}" -type f -name "*.png" -depth 1 -exec cp -fv {} $(distDir) \;

buildWorkflow:
	-[[ "${ALFRED_PKGMAN_WORKFLOW_DIR}" == "" ]] && { echo "ALFRED_PKGMAN_WORKFLOW_DIR is not set! Aborting!"; exit 1; }
	cp -fv "${ALFRED_PKGMAN_WORKFLOW_DIR}"/info.plist $(distDir)
	cd $(distDir) && zip -r $(workflowName) * -x "*.DS_Store"

release: | dist
	cp -fv $(distDir)/info.plist .
	cp -fv $(distDir)/$(workflowName) .


linkSourceFoldersToWorkflow:
	-[[ "${ALFRED_PKGMAN_WORKFLOW_DIR}" == "" ]] && { echo "ALFRED_PKGMAN_WORKFLOW_DIR is not set! Aborting!"; exit 1; }

	-[ -d "${ALFRED_PKGMAN_WORKFLOW_DIR}/bin" ] && mv -v "${ALFRED_PKGMAN_WORKFLOW_DIR}/bin" "${ALFRED_PKGMAN_WORKFLOW_DIR}/bin.bak"
{'fraction_non_alphanumeric': 0.17329956584659914, 'fraction_numerical': 0.002894356005788712, 'mean_word_length': 4.72463768115942, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4339862', 'n_tokens_mistral': 1167, 'n_tokens_neox': 1126, 'n_words': 248}