Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to prepare sha256 and use it on install #801

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

spk
Copy link
Contributor

@spk spk commented Apr 25, 2019

Hi, I would like to prepare and use a release-exe.sha256 file for each release and use it to check the checksum on the install.sh; I'm not sure about the result file and deploy process so maybe its a good template if its interesting for you ? cheers and thanks for this project!

@@ -7,6 +7,9 @@ package() {
fi

cp -f target/$TARGET/release/$BIN_NAME bin/$BIN_NAME_TAG
cd bin || return 1
sha256sum "$BIN_NAME_TAG" | tee "$BIN_NAME_TAG.sha256"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work!

Can you update this a little bit to

sha256sum "$BIN_NAME_TAG" | tee "bin/$BIN_NAME_TAG.sha256"

rather than changing dirs twice?

Copy link
Contributor Author

@spk spk May 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks sure done in 1509f42

@@ -11,18 +11,23 @@ name=languageclient

try_curl() {
command -v curl > /dev/null && \
curl --fail --location "$1" --output bin/$name
curl --fail --location "$1" --output bin/$name && \
curl --fail --location "$1.sha256" --output bin/$name.sha256
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it needed to cleanup previous sha256 before downloading? Like the current cleanup of bin file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the --output from curl and --output-document from wget the file will be overwritten so I don't think its useful but if you think its safer let me know

@spk spk force-pushed the checksum-download branch from 6d6d7e0 to 1509f42 Compare May 1, 2019 19:13
install.sh Outdated
}

download() {
echo "Downloading bin/${name}..."
url=https://github.com/autozimu/LanguageClient-neovim/releases/download/$version/${1}
if (try_curl "$url" || try_wget "$url"); then
sha256sum -c "bin/$name.sha256" || return 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late update.

Can you please split this PR into two? One includes generating the SHA files and the other downloading and checking SHA. Since this is modifying the installation, erroneous script will resulting release unable to install.

Another issue, can you print an error message here before return 1?

Thanks again for your contribution.

Copy link
Contributor Author

@spk spk May 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, yep you're right i've squashed and apply the error message on daf3d21 will create another PR for the generation (edit: #819), thanks for the feedback

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@spk spk force-pushed the checksum-download branch from 7e8faa6 to daf3d21 Compare May 8, 2019 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants