sgrep/semgrep: Updgrade and rename sgrep to semgrep.

With its new upgrade, sgrep has been renamed to semgrep.

Rename sgrep.yml to semgrep.yml
This commit is contained in:
Aman Agrawal
2020-04-27 13:46:16 +05:30
committed by Tim Abbott
parent a3d51ae9af
commit 5ab62a3514
6 changed files with 30 additions and 31 deletions

22
tools/setup/install-semgrep Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
version=0.5.0-dev.2
tarball=semgrep-v$version-ubuntu-16.04.tgz
sha256=3959f79b15c900d29567b6cb846831eb7da4c0a10969ffc98a1c9364ea377545
tarball_url=https://github.com/returntocorp/semgrep/releases/download/v$version/$tarball
check_version () {
out="$(semgrep --version 2>/dev/null)" && [ "$out" = "$version" ]
}
if ! check_version; then
tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir"
wget -nv "$tarball_url"
sha256sum -c <<< "$sha256 $tarball"
tar -xzf "$tarball" -C /usr/local/lib/
ln -sf /usr/local/lib/semgrep-files/semgrep /usr/local/bin/semgrep
ln -sf /usr/local/lib/semgrep-files/semgrep-core /usr/local/bin/semgrep-core
fi

View File

@@ -1,23 +0,0 @@
#!/usr/bin/env bash
set -e
version=0.4.9b5
tarball=sgrep-$version-ubuntu-16.04.tgz
sha256=9e57323fd0eb9133b7ff301a6be8361c073c3bfe6e6959ca1b622e5abc176e03
tarball_url=https://github.com/returntocorp/sgrep/releases/download/v$version/$tarball
check_version () {
out="$(sgrep-lint --version 2>/dev/null)" && [ "$out" = "$version" ]
}
if ! check_version; then
tmpdir="$(mktemp -d)"
trap 'rm -r "$tmpdir"' EXIT
cd "$tmpdir"
wget -nv "$tarball_url"
sha256sum -c <<< "$sha256 $tarball"
tar -xzf "$tarball" -C /usr/local/lib/
ln -sf /usr/local/lib/sgrep-lint-files/sgrep-lint /usr/local/bin/sgrep-lint
ln -sf /usr/local/lib/sgrep-lint-files/sgrep /usr/local/bin/sgrep
check_version
fi