diff --git a/action.yaml b/action.yaml index 208a04e..ae69250 100644 --- a/action.yaml +++ b/action.yaml @@ -127,10 +127,10 @@ runs: # Download custom gptscript log_info "Downloading platform-specific version 'v${{ inputs.gptscript-release }}' of gptscript...\n https://github.com/gptscript-ai/gptscript/releases/download/v${{ inputs.gptscript-release }}/${desired_gptscript_filename}" - # $SUDO curl -sL https://github.com/gptscript-ai/gptscript/releases/download/v${{ inputs.gptscript-release }}/${desired_gptscript_filename} -o ${desired_gptscript_filename} + $SUDO curl -sL https://github.com/gptscript-ai/gptscript/releases/download/v${{ inputs.gptscript-release }}/${desired_gptscript_filename} -o ${desired_gptscript_filename} $SUDO curl -sL https://github.com/gptscript-ai/gptscript/releases/download/v${{ inputs.gptscript-release }}/checksums.txt -o checksums.txt cat checksums.txt - sha256sum ${desired_gptscript_filename} + ls -la if [[ ${{ runner.os }} == "Windows" ]]; then log_info ">>> '${{ runner.os }}'" filesha256=$(cat checksums.txt | grep ${desired_gptscript_filename} | cut -d' ' -f1) @@ -145,7 +145,12 @@ runs: ret=$? if [[ $ret -eq 0 ]]; then log_info "unpacking!" - $SUDO unzip "${desired_gptscript_filename}" -d "${{ inputs.install-dir }}" + + if [[ "${desired_gptscript_filename}" == *".zip"* ]]; then + $SUDO unzip "${desired_gptscript_filename}" -d "${{ inputs.install-dir }}" + else + $SUDO tar xzf "${desired_gptscript_filename}" -C "${{ inputs.install-dir }}" + fi $SUDO rm -f checksums.txt $SUDO rm -f "${desired_gptscript_filename}" log_info "Installation complete!"