From 9f8abb62840da8f0a3501b45d41409a7adef107e Mon Sep 17 00:00:00 2001 From: ophub Date: Fri, 28 Jan 2022 14:10:35 +0800 Subject: [PATCH] Optimize custom templates --- action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 8ade383a76..9b48c02ff4 100644 --- a/action.yml +++ b/action.yml @@ -61,7 +61,6 @@ runs: run: | cd ${GITHUB_ACTION_PATH} echo -e "Current running path: [ ${PWD} ]" - echo -e "The contents of the current directory: $(ls .) \n" build_target="${{ inputs.build_target }}" [ -z "${build_target}" ] && build_target="armbian" @@ -129,13 +128,14 @@ runs: config_filepath="compile-kernel/tools/config" kernel_outpath="compile-kernel/output" - if [[ -n "${{ inputs.kernel_config }}" && "${{ inputs.kernel_config }}" != "${config_filepath}" ]]; then - if [[ -d "${GITHUB_WORKSPACE}/${{ inputs.kernel_config }}" ]]; then + if [[ -n "${{ inputs.kernel_config }}" ]]; then + if [[ "$(ls ${GITHUB_WORKSPACE}/${{ inputs.kernel_config }}/config-* -l 2>/dev/null | grep "^-" | wc -l)" -ne "0" ]]; then echo -e "Use a custom kernel compilation template." rm -f ${config_filepath}/* 2>/dev/null && sync - sudo cp -vf ${GITHUB_WORKSPACE}/${{ inputs.kernel_config }}/* ${config_filepath}/ 2>/dev/null && sync + sudo cp -vf ${GITHUB_WORKSPACE}/${{ inputs.kernel_config }}/config-* ${config_filepath}/ 2>/dev/null && sync + echo -e "List of Kernel Custom Compilation Configuration Templates: \n$(ls ${config_filepath})" else - echo -e "The custom kernel compilation template path is invalid, continue to use the default template" + echo -e "The custom kernel compilation template path is invalid, continue to use the default template." fi else echo -e "Use the default kernel compilation template."