Skip to content

Commit

Permalink
Optimize custom templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ophub committed Jan 28, 2022
1 parent d41d334 commit 9f8abb6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit 9f8abb6

Please sign in to comment.