mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-08 20:51:56 +08:00
Add a setgitversion
script to update the version string with git
This commit is contained in:
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
@@ -16,9 +16,12 @@ jobs:
|
|||||||
|
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Package Source
|
- name: Package Source
|
||||||
run: |
|
run: |
|
||||||
|
./setgitversion
|
||||||
mkdir source
|
mkdir source
|
||||||
cabal sdist
|
cabal sdist
|
||||||
mv dist-newstyle/sdist/*.tar.gz source/source.tar.gz
|
mv dist-newstyle/sdist/*.tar.gz source/source.tar.gz
|
||||||
|
11
setgitversion
Executable file
11
setgitversion
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/sh -xe
|
||||||
|
# This script hardcodes the `git describe` version as ShellCheck's version number.
|
||||||
|
# This is done to allow shellcheck --version to differ from the cabal version when
|
||||||
|
# building git snapshots.
|
||||||
|
|
||||||
|
file="src/ShellCheck/Data.hs"
|
||||||
|
test -e "$file"
|
||||||
|
tmp=$(mktemp)
|
||||||
|
version=$(git describe)
|
||||||
|
sed -e "s/=.*VERSIONSTRING.*/= \"$version\" -- VERSIONSTRING, DO NOT SUBMIT/" "$file" > "$tmp"
|
||||||
|
mv "$tmp" "$file"
|
@@ -4,7 +4,7 @@ import ShellCheck.Interface
|
|||||||
import Data.Version (showVersion)
|
import Data.Version (showVersion)
|
||||||
import Paths_ShellCheck (version)
|
import Paths_ShellCheck (version)
|
||||||
|
|
||||||
shellcheckVersion = showVersion version
|
shellcheckVersion = showVersion version -- VERSIONSTRING
|
||||||
|
|
||||||
internalVariables = [
|
internalVariables = [
|
||||||
-- Generic
|
-- Generic
|
||||||
|
Reference in New Issue
Block a user